summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2011-08-25 11:43:40 +0800
committerRay Chen <raychen@google.com>2011-08-25 11:55:59 +0800
commitbd8e025f1bb39b2be236b183ea8e78f93b308ad1 (patch)
tree4e55c19a93cc9211a1f01ee40c55183a90269425
parent60cb2b3f149db439eec4e3dfe25dad34e38848ea (diff)
downloadandroid_packages_apps_Gallery2-bd8e025f1bb39b2be236b183ea8e78f93b308ad1.tar.gz
android_packages_apps_Gallery2-bd8e025f1bb39b2be236b183ea8e78f93b308ad1.tar.bz2
android_packages_apps_Gallery2-bd8e025f1bb39b2be236b183ea8e78f93b308ad1.zip
Fix 5188970 Cannot close Gallery when opened from Email/Gmail
Change-Id: I7af203a9aec8ebaf6c33fa592c996f917e0caca8
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java3
-rw-r--r--src/com/android/gallery3d/app/AlbumSetPage.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index 5c09ce2d2..1b6145f74 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -458,6 +458,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
@Override
protected boolean onItemSelected(MenuItem item) {
switch (item.getItemId()) {
+ case R.id.action_cancel:
+ mActivity.getStateManager().finishState(this);
+ return true;
case R.id.action_select:
mSelectionManager.setAutoLeaveSelectionMode(false);
mSelectionManager.enterSelectionMode();
diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java
index 688ff81f2..73500c820 100644
--- a/src/com/android/gallery3d/app/AlbumSetPage.java
+++ b/src/com/android/gallery3d/app/AlbumSetPage.java
@@ -408,6 +408,10 @@ public class AlbumSetPage extends ActivityState implements
protected boolean onItemSelected(MenuItem item) {
Activity activity = (Activity) mActivity;
switch (item.getItemId()) {
+ case R.id.action_cancel:
+ activity.setResult(Activity.RESULT_CANCELED);
+ activity.finish();
+ return true;
case R.id.action_select:
mSelectionManager.setAutoLeaveSelectionMode(false);
mSelectionManager.enterSelectionMode();