public long getLastId(){
String query = "SELECT ROWID from "+TABLE_NAME+" order by ROWID DESC limit 1";
Cursor c = db.rawQuery(query,null);
long lastId=0;
if (c != null && c.moveToFirst()) {
lastId = c.getLong(0); //The 0 is the column index, we only have 1 column, so the index is 0
}
return lastId;
}
09-03
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交