【发布时间】:2011-06-18 16:17:11
【问题描述】:
我有一个带有复选框的 android.R.layout.simple_list_item_multiple_choice 想要启动其中的一些。 我怎样才能做到这一点? 我有以下代码:
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);
}
【问题讨论】:
-
你看过这个:developer.android.com/reference/android/widget/CheckBox.html 对你没有帮助吗?
标签: android list checkbox adapter