diff options
author | Hung-ying Tyan <tyanh@google.com> | 2011-09-30 14:42:50 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2011-10-07 18:57:06 +0800 |
commit | 57cbaa1ef40d2215c6400f5ae4af3a09e67abb2d (patch) | |
tree | 3ea6a3f73ce7ff4aa309cc79a109fd6860f08300 /src/com/android/gallery3d/app/StateManager.java | |
parent | eaa750f62a064e142605c3531539699469948983 (diff) | |
download | android_packages_apps_Gallery2-57cbaa1ef40d2215c6400f5ae4af3a09e67abb2d.tar.gz android_packages_apps_Gallery2-57cbaa1ef40d2215c6400f5ae4af3a09e67abb2d.tar.bz2 android_packages_apps_Gallery2-57cbaa1ef40d2215c6400f5ae4af3a09e67abb2d.zip |
Request sync when there's no mediaItem in a mediaSet.
This is to fix the problem where media items haven't been sync'ed when the album
set or album is viewed for the first time.
+ Add MediaSet.SyncListener.
+ Make AlbumPage and AlbumSetPage implement SyncListener.
+ Implement requestSync() for ComboAlbum and ComboAlbumSet.
+ add ActivityState.isDestroyed(). This also fixes the problem where
StateManager.finishState() may be called twice.
Bug: 5337899
Change-Id: I25364c3ac25721a2650701c5d7931bfb6daa9303
Diffstat (limited to 'src/com/android/gallery3d/app/StateManager.java')
-rw-r--r-- | src/com/android/gallery3d/app/StateManager.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/app/StateManager.java b/src/com/android/gallery3d/app/StateManager.java index 9c55fbd15..556a06aa4 100644 --- a/src/com/android/gallery3d/app/StateManager.java +++ b/src/com/android/gallery3d/app/StateManager.java @@ -161,9 +161,14 @@ public class StateManager { void finishState(ActivityState state) { Log.v(TAG, "finishState " + state.getClass()); if (state != mStack.peek().activityState) { - throw new IllegalArgumentException("The stateview to be finished" - + " is not at the top of the stack: " + state + ", " - + mStack.peek().activityState); + if (state.isDestroyed()) { + Log.d(TAG, "The state is already destroyed"); + return; + } else { + throw new IllegalArgumentException("The stateview to be finished" + + " is not at the top of the stack: " + state + ", " + + mStack.peek().activityState); + } } // Remove the top state. |