Vân Anh Nguyen
Member
How we can create database in Android?
Answer
Use the updateHandler() method as follows:
Answer
Use the updateHandler() method as follows:
- public boolean updateHandler(int ID, String name) {
- SQLiteDatabase db = this. getWritableDatabase();
- ContentValues args = new ContentValues();
- args. put(COLUMN_ID, ID);
- args. put(COLUMN_NAME, name);
- return db. update(TABLE_NAME, args, COLUMN_ID + “=” + ID, null) > 0;
- }