Listactivity + icon in android..:D

after 2 days meditation with android ebook, now i’m wake up and try developing my first android application..:]

package tanya.jawab2;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Pilihansoal extends ListActivity{
	private String[] mtpelajaran = {"matematika","b.indonesia","b.inggris"};
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
//		setContentView(R.layout.pertanyaan);
		
		setListAdapter(new ArrayAdapter (this,android.R.layout.simple_list_item_checked,mtpelajaran));
		ListView listView = getListView();

        listView.setItemsCanFocus(false);
        listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
	}
}

this output:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s