我的数据库有12个值我使用表格布局和列表视图但在第二行它再次开始显示来自数据库的第二个值
class NoteHolder {
private Button b1 = null;
private Button b2 = null;
private Button b3 = null;
NoteHolder(View row) {
b1 = (Button) row.findViewById(R.id.one);
b2 = (Button) row.findViewById(R.id.two);
b3 = (Button) row.findViewById(R.id.three);
}
void populateFrom(Cursor c, NoteHelper helper) {
b1.setText(helper.getNote(c));
c.moveToNext();
b2.setText(helper.getNote(c));
c.moveToNext();
b3.setText(helper.getNote(c));
}
}
答案 0 :(得分:1)
从您的班级中删除静态关键字。
答案 1 :(得分:1)
Cursor.moveToNext()
移动光标。
http://developer.android.com/reference/android/database/Cursor.html#moveToNext%28%29