这只是我正在使用的数据库的简化版本:
让我们说如果我想查询获取ID 101,102,114,212和256。
cursorLoader = new MyCursorLoader(getActivity()) {
@Override
public Cursor loadInBackground() {
Cursor c = null;
String selection = COL_PERSON_ID + " = ?";
String[] selectionArgs = new String[]{"101","102","114","212","256"};
c = getActivity().getContentResolver().query(CONTENT_URI, null, selection, selectionArgs, null);
return c;
}
};
运行之后我崩溃了,
java.lang.IllegalArgumentException: Cannot bind argument at index 5 because the index is out of range. The statement has 1 parameters.
我找到了相关的帖子但没有什么可以回答我的需要。