【发布时间】:2019-09-10 23:33:52
【问题描述】:
每当我尝试显示 nexpdate 的值时,我都会得到空值。我收到以下错误 android.database.sqlite.sqlitecursor @ .
// insertion of values in renew table
public void insertrenew (String rcode, String nexpdate) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put("rcode", rcode);
contentValues.put("nexpdate", nexpdate);
db.insert("renew", null, contentValues);
}
//java code to get the value of nexpdate
public String getrenew (String rcode) {
SQLiteDatabase db = this.getReadableDatabase();
String selectQuery = "SELECT nexpdate from renew where rcode = " + rcode;
String cursor = String.valueOf(db.rawQuery(selectQuery, null));
return cursor;
}
【问题讨论】:
-
你能分享你得到的确切错误吗?检查 logcat 输出并在此处分享。