主要是:
cursor那里改怎么写??我这样写的,
dbheHelper = new DataBaseHelper(ReadAct.this, Y_Date + "-" + M_Date);
db = dbheHelper.getReadableDatabase();
Cursor cursor = db.query("diaries_table", new String[] { "date_id", "date",
"title", "content" }, null, null, null, null, null);
while (cursor.moveToNext()) {
String date_id = cursor.getString(cursor.getColumnIndex("date_id"));
if (date_id.equals(String.valueOf(dbIndex))) {
title = cursor.getString(cursor.getColumnIndex("title"));
content = cursor.getString(cursor.getColumnIndex("content"));
titleView.setText(title);
contentView.setText(content);
} else {

}
}
System.out.println("执行到这里了");
报RunTimeException,由空指针异常引起的。
我想做到从sqlite里取得指定id的,指定列标的数据放入字符串中。然后在指定的textview里显示出来。