在以下情况下如何合并游标加载器以获得一个游标加载器。我不止一个调用内容提供者来创建我的数据库适配器以与简单的游标适配器一起使用。请在下面查看我的代码。
@Override
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
productIdCursor.moveToFirst();
CursorLoader cursorLoader;
// CursorLoader cursorLoader;
int i = 0;
while (productIdCursor.isLast()) {
String[] Projection = { "p.id as _id", "p.name", "p.subTitle",
"p.textColour", "pi.thumb" };
String userSelectionCritera = "p.id = pp.prod_id and pp.imag_id = pi.id and p.id= ? and p.id = pc. prod_id and pc.coun_id = ?";
String[] selecttionArgs = new String[] {
productIdCursor.getString(productIdCursor
.getColumnIndex("prod_id")),
String.valueOf(countryId) };
cursorLoader = new CursorLoader(getActivity(),
DatabaseContentProvider.CONTENT_URI_PRODUCTCATEGORY,
Projection, userSelectionCritera, selecttionArgs, null);
productIdCursor.moveToNext();
}
return cursorLoader;