SQLite in Android How to update a specific row

First make a ContentValues object :

ContentValues cv = new ContentValues();
cv.put("Field1","Bob"); //These Fields should be your String values of actual column names
cv.put("Field2","19");
cv.put("Field2","Male");

Then use the update method, it should work now:

myDB.update(TableName, cv, "_id = ?", new String[]{id});

Leave a Comment