FileDocCategorySizeDatePackage
List10.javaAPI DocAndroid 1.5 API1655Wed May 06 22:41:08 BST 2009com.example.android.apis.view

List10

public class List10 extends android.app.ListActivity
This example shows how to use choice mode on a list. This list is in CHOICE_MODE_SINGLE mode, which means the items behave like checkboxes.

Fields Summary
private static final String[]
GENRES
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_single_choice, GENRES));
        
        final ListView listView = getListView();

        listView.setItemsCanFocus(false);
        listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);