I want to update multiple rows. Like make status=false where status=true and make status=true where id=x
try {
String where = "id=?";
String[] whereArgs = new String[] { Id };
SQLiteDatabase db = this.getWritableDatabase();
ContentValues initialValues = new ContentValues();
initialValues.put("status", "true");
db.update(TABLE_PROJECT, initialValues, where, whereArgs);
db.close();
} catch (Exception e) {
Log.e("Exception in update query", e.toString());
}
Currently what happens i am able to update the status first time but when it comes next time i need to change the previous status to false and then update new one with true. I searched and found that it can be done with switch case but here how can we apply this?