Skip to main content

Android error: java.lang.IllegalStateException: trying to requery an already closed cursor

FIX: use context.getContentResolver().query instead of activity.managedQuery.
Cursor cursor = null;
try {
    cursor = context.getContentResolver().query(uri, PROJECTION, null, null, null);
} catch(Exception e) {
    e.printStackTrace();
}
return cursor;

Comments