OSDN Git Service

Fix issue #3381489: IllegalStateException: attempt to re-open...
authorDianne Hackborn <hackbod@google.com>
Mon, 31 Jan 2011 00:55:55 +0000 (16:55 -0800)
committerDianne Hackborn <hackbod@google.com>
Mon, 31 Jan 2011 01:58:49 +0000 (17:58 -0800)
commit260c3c77d9b340164e055f87002c64d78da6e836
tree194e78856f8c68d027b70161337fa9fd5a842bc8
parentfba54f620ff155ede6de7d73f1b6a0003839b1c4
Fix issue #3381489: IllegalStateException: attempt to re-open...

...an already-closed object: android.database.sqlite.SQLiteQuery

It turns out there is a state we are missing -- the loader is
still needed, but in the inactive list.  In this case the loader
needs to continue holding on to its current data, and not deliver
any new data (which would result in it releasing its old data).

This introduces the new state to Loader, and uses it in
AsyncTaskLoader so all subclasses of that should get the new
correct behavior.

A further improvement would be to unregister CursorLoader's
content listener when going in to this state, but that can
wait for later.

Change-Id: I6d30173b94f8e30b5be31d018accd328cc3388ec
api/11.xml
api/current.xml
core/java/android/app/LoaderManager.java
core/java/android/content/AsyncTaskLoader.java
core/java/android/content/Loader.java