This problem appeared to me with a CursorLoader returning a cursor that was already closed:
android.database.StaleDataException: Attempted to access a cursor after it has been closed.
I assume this is a mistake or oversight. Although moving initLoader () to onResume might work, what I was able to do was remove Loader when I was done with it:
To start the bootloader (in my onCreate):
getLoaderManager().initLoader(MUSIC_LOADER_ID, null, this);
Then after I finished with it (mostly at the end of onLoadFinished)
getLoaderManager().destroyLoader(MUSIC_LOADER_ID);
This is similar to the behavior as expected, no additional calls.
Matt Mar 04 '14 at 21:17 2014-03-04 21:17
source share