Belajardengan.com merupakan domain blog lama dari delajardengan.blogspot.com. Mohon kritik dan sarannya untuk perkembangan blog ini.
email: blog.tkx.pnp@gmail.com

coba Belajar Adroid (6)

♠ Posted by Unknown in at 1:29 AM

source code  6


Tes2sanActivity.java

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageButton;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageButton;

public class Tes2sanActivity extends Activity {
    /** Called when the activity is first created. */
Button btn;
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        btn.setImageResource(R.drawable.icon);
        ImageButton btn = (ImageButton)this.findViewById(R.id.imageButton1);

}
}

main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<ImageButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/imageButton1" android:src="@drawable/icon"></ImageButton>
</LinearLayout>



hasilnya:


0 komentar:

Post a Comment