summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 9f7a054d8..287df66b7 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -425,7 +425,13 @@ public abstract class PhotoPage extends ActivityState implements
mIsFromWidget = data.getBoolean(KEY_IS_FROM_WIDGET, false);
mStartInFilmstrip = data.getBoolean(KEY_START_IN_FILMSTRIP, false);
boolean inCameraRoll = data.getBoolean(KEY_IN_CAMERA_ROLL, false);
- mCurrentIndex = data.getInt(KEY_INDEX_HINT, 0);
+ if (restoreState == null || mSetPathString == null) {
+ mCurrentIndex = data.getInt(KEY_INDEX_HINT, 0);
+ } else {
+ mCurrentIndex = restoreState.getInt(KEY_INDEX_HINT, 0);
+ //we only save index in onSaveState, set itemPath to null to get the right path later
+ itemPath = null;
+ }
if (mSetPathString != null) {
mShowSpinner = true;
mAppBridge = (AppBridge) data.getParcelable(KEY_APP_BRIDGE);
@@ -614,6 +620,12 @@ public abstract class PhotoPage extends ActivityState implements
}
@Override
+ protected void onSaveState(Bundle outState) {
+ outState.putInt(KEY_INDEX_HINT,mCurrentIndex);
+ super.onSaveState(outState);
+ }
+
+ @Override
public void onPictureCenter(boolean isCamera) {
isCamera = isCamera || (mHasCameraScreennailOrPlaceholder && mAppBridge == null);
mPhotoView.setWantPictureCenterCallbacks(false);