I\'m trying to batch delete some items in a table.
String ids = { \"1\", \"2\", \"3\" };
mContentResolver.delete(uri, MyTables._ID + \"=?\", ids);
<
The error occurs because you have a single placeholder (?) in your where clause, while you pass three arguments. You should do:
String ids = { "1", "2", "3" };
mContentResolver.delete(uri, MyTables._ID + "=? OR " + MyTables._ID + "=? OR " + MyTables._ID + "=?", ids);
I do not know if SQLite supports the IN clause, if so you could also do:
String ids = { "1, 2, 3" };
mContentResolver.delete(uri, MyTables._ID + " IN (?)", ids);