Using insertWithOnConflict for update or insert
I need to insert or update and I found the method insertWithOnConflict of the SQLiteDatabase, but I do not know how it checks if the entry already exists. Theoretically I need a "Where" argument to check if a certain ID exists, and if so, it should replace all other columns. This is what I have now, but I don´t think that the second argument is the unique id ContentValues args = new ContentValues(); args.put(AppDatabase.COLUMN_ID, entry.getId()); args.put(AppDatabase.COLUMN_NAME, entry.getAppname()); args.put(AppDatabase.COLUMN_URL, entry.getAppUrl()); database.insertWithOnConflict(AppDatabase