Answer the question
In order to leave comments, you need to log in
How to catch an IllegalStateException that is not being caught?
Dear habra community, here's a riddle for you. I've been solving for a few days now. I've never dealt with mobile development before, but damn it. Designed a database application. And the base is big, but that's okay. Everything was going well until I added too many fragments and everything fell into the abyss.
Introductory:
The application has several fragments with a ListView. They are filled from the database using a combination of SimpleCursorAdapter and Cursor Loader.
Let's take a look at the error log:
10-14 19:29:34.313 24409-24409/ru.endid.sqliteproject E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: ru.endid.sqliteproject, PID: 24409
java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteQuery: SELECT _id, name FROM company ORDER BY name
at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:58)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:152)
at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:124)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:214)
at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
at android.widget.CursorAdapter.getItemId(CursorAdapter.java:223)
at android.widget.AbsListView.onSaveInstanceState(AbsListView.java:1764)
at android.view.View.dispatchSaveInstanceState(View.java:12728)
at android.view.ViewGroup.dispatchFreezeSelfOnly(ViewGroup.java:2629)
at android.widget.AdapterView.dispatchSaveInstanceState(AdapterView.java:783)
at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2615)
at android.view.View.saveHierarchyState(View.java:12711)
at android.app.FragmentManagerImpl.saveFragmentViewState(FragmentManager.java:1577)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:951)
at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1167)
at android.app.BackStackRecord.run(BackStackRecord.java:641)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question