2013-05-15 69 views
2

我有一個gridview填充SimpleCursor適配器和加載程序管理器(支持v4)的幫助。 Gridview的內容是通過分頁幫助從Web服務器獲取的。如果我在webservice調用期間快速切換詳細視圖和gridview之間的視圖,我得到了非法狀態錯誤/ StaleDataException。SimpleCursor適配器,LoaderManager非法狀態異常或陳舊數據異常

05-15 00:36:54.114: E/AndroidRuntime(10656): java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteQuery: SELECT * FROM product_list WHERE (url = ?) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:58) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:151) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:124) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:213) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.support.v4.widget.CursorAdapter.getView(CursorAdapter.java:247) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.widget.AbsListView.obtainView(AbsListView.java:2452) 
05-15 00:36:54.114: E/AndroidRuntime(10656): at android.widget.GridView.makeAndAddView(GridView.java:1331 

回答

0

也許你忘了在resetLoader回調添加adapter.swapcursor(空)? 我遇到同樣的日誌,而這是失蹤,並打開+關閉listfragment幾次..