Assuming you are using a ListActivity implementation of OnItemClickListener you can use this code:
ArrayAdapter<Object> ad = new ArrayAdapter<Object>(this, android.R.layout.simple_list_item_checked, items); setListAdapter(ad); ListView list = getListView(); list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
EDIT: Otherwise, if you are not expanding ListActivity, use listview in your layout and replace ListView list = getListView() with something like ListView list = findViewById(R.id.listView) . Replace list.setOnItemClickListener(this) with
list.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { } });
Force source share