To use the method from android with the predefined update , use it as shown below:
ContentValues args = new ContentValues(); args.put("col_name", "new value"); db.update("table_name", args, String.format("%s = ?", "primary_column"), new String[]{"primary_id"});
Or to run as a single line, go to this (not recommended):
db.execSQL("UPDATE table_name SET col_name='new_value' WHERE primary_column='primary_id'");
source share