mids包含2个字符串:名称和ID。我想向我的IN子句收取ID。任何想法我怎么可能这样做而不迭代循环来构建以args形式输入的数组?
private List<Contacts> getCntctList(List<GroupMembers> mids){
List<Contacts> cntcts = new ArrayList<Contacts>();
ContentResolver cr = getContentResolver();
Object[] mIDs = mids.toArray();
Cursor contactCur = cr.query(People.CONTENT_URI, null, "People._ID IN (?)", new String [] { mIDs.toString() } , People.NAME + " ASC");
if (contactCur.getCount() > 0) {
while (contactCur.moveToNext()) {
...
}
}
return cntcts;
}