How can I merge cursor loader in the following case to get one Cursor loader. I am calling content provider more than one to create my database adapter to use with simple cursor adapter. Please look my code below.
@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;