Sadece yeni cursorLoader ile oynamaya başladım ve sorunla karşılaşıyorum. Aşağıdaki kod, yalnızca imleçLoader'ın nasıl çalıştığını anlamak içindir, ancak bu etkinliğe devam ettiğimde şu satırı almaya devam ediyorum:Android CursorLoader
"İstenmeyen ve zaten kapatılmış imleç çalıştırılıyor". Ben cursorLoader ile oynamaya başlamadan önce uygulama iyi çalışıyordu. Herhangi bir fikir?
private Cursor getSectionData(CharSequence parent_id) {
String[] projection = new String[] {Titles.SECTION, Titles.TITLE, Titles._ID, Titles.CODE_RANGE,};
Uri titles = Titles.CONTENT_URI;
String select = "" + Titles.PARENT_ID + " match " + parent_id + "";
CursorLoader loader = new CursorLoader(this, titles, projection, select, null, null);
Cursor cTitles = loader.loadInBackground();
String[] projection1 = new String[] {Codes.CODE, Codes.EXCERPT, Codes._ID,};
Uri codes = Codes.CONTENT_URI;
String select1 = "" + Codes.PARENT_ID + " match " + parent_id + "";
CursorLoader loader1 = new CursorLoader(this, codes, projection1, select1, null, null);
Cursor cCodes = loader1.loadInBackground();
//Cursor cTitles = db.rawQuery("select section, title, _id, code_range from titles where parent_id match " + parent_id + "", null);
//startManagingCursor(cTitles);
//Cursor cCodes = db.rawQuery("select code, excerpt, _id from codes where parent_id match " + parent_id + "", null);
mQuery = "select code, excerpt, _id from codes where parent_id match " + parent_id + "";
//startManagingCursor(cCodes);
Cursor[] c = {cTitles, cCodes};
Cursor cursor = new MergeCursor(c);
startManagingCursor(cursor);
return cursor;
}
i yöntem registerListener olsun (int, Loader.OnLoadCompleteListener) tipi Loader argümanlar için geçerli değildir (int, LoaderManager.LoaderCallbacks ) –
max4ever
Bu gönderi biraz eski, bir şey güncelleştirdiler emin değil. LoaderCallbacks yerine bir OnLoadCompleteListener oluşturmayı denediniz mi? –