[ImageButton, Toast]

|

C++pasted just now: 
package net.itisn.test;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class FrameLayoutTest extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		ImageButton btn1 = (ImageButton) this.findViewById(R.id.ImageButton01);
		ImageButton btn2 = (ImageButton) this.findViewById(R.id.ImageButton02);
		ImageButton btn3 = (ImageButton) this.findViewById(R.id.ImageButton03);
		ImageButton btn4 = (ImageButton) this.findViewById(R.id.ImageButton04);

		btn1.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Toast.makeText(FrameLayoutTest.this, "Hi~~ north",
				        Toast.LENGTH_LONG).show();
			}
		});
	}
}


d
Haskellpasted 1 second ago: 
<?xml version="1.0" encoding="utf-8"?>

<FrameLayout
	android:id="@+id/FrameLayout01"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	xmlns:android="http://schemas.android.com/apk/res/android"
>
	<ImageButton
		android:id="@+id/ImageButton01"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_gravity="top|center"
		android:background="@drawable/su"
	></ImageButton>
	<ImageButton
		android:id="@+id/ImageButton02"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_gravity="left|center"
		android:src="@drawable/icon"
	></ImageButton>
	<ImageButton
		android:id="@+id/ImageButton03"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_gravity="right|center"
		android:src="@drawable/icon"
	></ImageButton>
	<ImageButton
		android:id="@+id/ImageButton04"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_gravity="bottom|center"
		android:src="@drawable/icon"
	></ImageButton>

</FrameLayout>


-

'Android' 카테고리의 다른 글

[CustomAdapter]  (0) 2010.09.30
[MyHandlerTest]  (0) 2010.09.28
[AlertDialog2]  (0) 2010.08.19
[AlertDialog]  (0) 2010.08.18
[MenuTest]  (0) 2010.08.18
And