· 7 years ago · Feb 26, 2019, 11:58 AM
1public static final String DB_T_MYTABLE = "CREATE TABLE IF NOT EXISTS mytable(entity text primary key, last_change_date integer not null);";
2 _db.execSQL(DB_T_MYTABLE );
3
4ContentValues cv = new ContentValues();
5 cv.put("last_change_date", ((int)(cal.getTimeInMillis()/1000))); // cal is Calendar object
6
7 String whereClause = "mytable.entity= 'service' ";
8 int r = dbManager.updateTable("mytable", cv, whereClause);
9
10int t= ((int)(cal.getTimeInMillis()/1000)))
11 String query = "update mytable set last_change_date = '"+t+"' where entity= 'service'";
12 dbManager.RawQuery(q, null);