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

List11

public class List11 extends android.app.ListActivity
This example shows how to use choice mode on a list. This list is in CHOICE_MODE_MULTIPLE 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_multiple_choice, GENRES));
        
        final ListView listView = getListView();

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