这是我用来从数据库动态加载数据的代码,但我没有得到如何动态检查或取消选中复选框?这是我正在使用的代码。
String[] from = new String[]{"ToDisplay","MblNo", "_id"};
// and an array of the fields we want to bind those fields to (in this case just tvViewRow)
int[] to = new int[]{R.id.tvViewRow};
// Now create a simple cursor adapter and set it to display
SimpleCursorAdapter cursor = new SimpleCursorAdapter(this, R.layout.white_row, coloursCursor, from, to);
setListAdapter(cursor);
Cursor curs = DisplayWhiteAddress();
curs.moveToFirst();
int i=0;
while(!curs.isAfterLast()){
String s=""+curs.getString(2);
myArrayList.add(i, s);
s=""+curs.getString(0);
myNumberList.add(i, s);
ListIndices.add(i,Integer.parseInt(""+curs.getString(0)));
curs.moveToNext();
i++;
}