如何檢查,如果某個值,請在表中的列或不我用這樣的方式,但應用程序崩潰時的值不在表的值檢查查詢存在
Cursor r = db.query(DATABASE_TABLE3,
new String[] { "_id", "point_name", "No_of_visits" },
"point_langtitude" + "=" + lang + " and " + "point_latitude"
+ "=" + lat,
null,
null,
null,
null);
if(r == null)
{
return true;
}
else
{
r.moveToFirst();
ContentValues args = new ContentValues();
args.put("No_of_visits", 7);
boolean d = db.update(DATABASE_TABLE3,
args,
"_id" + "=" + r.getInt(0),
null) > 0;
return false;
}
你能後的logcat的輸出之前使用調試器吧。 – Flo 2011-06-03 11:31:40
06-03 11:43:27.820:錯誤/數據庫(490):錯誤插入points_counter = 1 point_langtitude = -10084093 _id = 26 point_latitude = 37422005 06-03 11:43:27.820:錯誤/數據庫(490):android .database.sqlite.SQLiteConstraintException:錯誤代碼19:約束失敗 – jamil 2011-06-03 11:44:59
請任何幫助我需要這個在我的畢業項目 – jamil 2011-06-03 11:54:35