While working on the project and struggling with this very question, I found these other questions (and answers) useful:
Here is what I found:
String[] args = new String[] {"A", "B"}; Cursor cur = db.query("tab1", null, "name in(?,?)", args, null, null, null);
How will it be:
String args = "A, B"; Cursor cur = db.query("tab1", null, "name in(" + args + ")", null, null, null, null);
So you can use a few ? with the IN() operator and map each to an element in the selectionArgs array (as in the first example). If you have multiple conditions in a WHERE , make sure it matches ? with the correct item in selectionArgs :
String[] args = new String[] {"Current", "A", "B"}; Cursor cur = db.query("tab1", null, "IsCurrent=? AND name in(?,?)", args, null, null, null);
Or you can simply use a string consisting of arguments separated by commas directly in the IN() statement in the selection string itself (for example, the second example).
Related questions seemed to indicate that you could use one ? in IN() and somehow extend the related parameters, but I could not get this to work.