我有一个android.R.layout.simple_list_item_multiple_choice复选框,想要启动其中的一些。 我该怎么做? 我有以下代码:Android:如何设置列表项检查?
private void fillList() {
Cursor NotesCursor = mDbHelper.fetchAllNotes();
startManagingCursor(NotesCursor);
String[] from = new String[] { NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_BODY, NotesDbAdapter.KEY_CHECKED };
int[] to = new int[] {
android.R.id.text1,
android.R.id.text2,
//How set checked or not checked?
};
SimpleCursorAdapter notes = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_multiple_choice, NotesCursor,
from, to);
setListAdapter(notes);
}
你见过这样的:http://developer.android.com/reference /android/widget/CheckBox.html 不帮你吗? – gnclmorais 2011-01-31 15:52:44