android java.lang.IllegalStateException: trying to requery an already closed cursor
錯誤提示:
Java.lang.RuntimeException: Unable to resume activity {com.lenovo.leos.memowidget/com.lenovo.leos.notepad.NoteEditor}: java.lang.IllegalStateException: trying to requery an already closed cursor
可能錯誤的使用方法:
query(android.net.Uri, String[], String, String[], String)
startManagingCursor(Cursor)
由activity在通過query獲取了Cursor之後用startManagingCursor來管理Cursor的生命週期的,那麼每一次呼叫完畢之後Cursor也會相應的被關閉;由此從history menu tab進入的時候則可能因為Cursor被關閉了而導致異常。
解決辦法:
不使用startManagingCursor(Cursor)來管理Cursor的生命週期,自己使用.close()管理。
相關文章
- 解決okhttp報java.lang.IllegalStateException: closed,java.lang.IllegalStateException: closedHTTPJavaException
- java.lang.IllegalStateException: closedJavaException
- java.lang.IllegalStateException: getOutputStream() has already been called for this responseJavaException
- Caused by: java.lang.IllegalStateException: getWriter() has already been called for this responseJavaException
- java.lang.IllegalStateException: getOutputStream() has already been called for this response解決方案JavaException
- ViewPager內使用FragmentPagerAdapter時滑動出現 java.lang.IllegalStateException: The specified child already hViewpagerFragmentAPTJavaException
- prettier Unexpected closing tag "p". It may happen when the tag has already been closed by another tag.APP
- Bitmap回收—Canvas: trying to use a recycled bitmap android.graphicsCanvasAndroid
- [求助]SQLException: ResultSet is closedSQLException
- Android中Cursor 的一些方法Android
- java.lang.IllegalStateException: getWriteableDatabase called recursivelyJavaExceptionDatabase
- 3.2.2 Opening a Closed DatabaseDatabase
- java.lang.IllegalStateException: Service id not legal hostnameJavaException
- 使用高德地圖時出現 trying to use a recycled bitmap android.graphics.Bitmap地圖Android
- android/libs/libammsdk.jar" already exists! 解決方法AndroidJAR
- Trying to hack Redis via HTTP requestsRedisHTTP
- shared SQL,parent cursor,child cursorSQL
- Spider closed (finished) 沒完成IDE
- 【CURSOR】Oracle 遊標 (cursor)知識梳理Oracle
- Oracle CursorOracle
- Cursor使用
- Thread already joined at **thread
- open_cursor & session_cached_cursor實驗Session
- 理解V$OPEN_CURSOR,SESSION_CACHED_CURSORSession
- java.lang.IllegalStateException:YouneedtouseaTheme.AppCompatthemeJavaExceptionAPP
- Android學習過程的Cursor遊標填坑筆記Android筆記
- 奇怪報錯資訊“db already exists with different case already have”解決方法
- 理解V$OPEN_CURSOR, V$SESSION_CACHED_CURSORSession
- getOutputStream() has already been called
- efcore This MySqlConnection is already in useMySql
- PL/SQL cursorSQL
- [zt] 理解V$OPEN_CURSOR, V$SESSION_CACHED_CURSORSession
- python程式碼錯誤RuntimeError: Session is closedPythonErrorSession
- Oracle:cursor:mutex XOracleMutex
- ActiveMQ - message cursorMQ
- SQL 遊標cursorSQL
- 'cursor:mutex ..'/ 'cursor:pin ..'/ 'library cache:mutex ..'型別的等待事件Mutex型別事件
- v$sqlarea_parent cursor_v$sql_child cursor關係SQL