summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/gallery3d/app/Gallery.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/gallery3d/app/Gallery.java b/src/com/android/gallery3d/app/Gallery.java
index b35c11496..488c6c12f 100644
--- a/src/com/android/gallery3d/app/Gallery.java
+++ b/src/com/android/gallery3d/app/Gallery.java
@@ -194,19 +194,22 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi
} else {
Path itemPath = dm.findPathByUri(uri, intent.getType());
Path albumPath = dm.getDefaultSetOf(itemPath);
- // TODO: Make this parameter public so other activities can reference it.
- boolean singleItemOnly = intent.getBooleanExtra("SingleItemOnly", false);
- if (!singleItemOnly && (albumPath != null)) {
- data.putString(PhotoPage.KEY_MEDIA_SET_PATH, albumPath.toString());
- }
+
data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString());
- if (intent.getBooleanExtra(PhotoPage.KEY_TREAT_BACK_AS_UP, false)) {
- data.putBoolean(PhotoPage.KEY_TREAT_BACK_AS_UP, true);
- } else if ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) {
+
+ // TODO: Make the parameter "SingleItemOnly" public so other
+ // activities can reference it.
+ boolean singleItemOnly = (albumPath == null)
+ || intent.getBooleanExtra("SingleItemOnly", false);
+ if (!singleItemOnly) {
+ data.putString(PhotoPage.KEY_MEDIA_SET_PATH, albumPath.toString());
// when FLAG_ACTIVITY_NEW_TASK is set, (e.g. when intent is fired
// from notification), back button should behave the same as up button
// rather than taking users back to the home screen
- data.putBoolean(PhotoPage.KEY_TREAT_BACK_AS_UP, true);
+ if (intent.getBooleanExtra(PhotoPage.KEY_TREAT_BACK_AS_UP, false)
+ || ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0)) {
+ data.putBoolean(PhotoPage.KEY_TREAT_BACK_AS_UP, true);
+ }
}
// Displays the filename as title, reading the filename from the interface: