summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2017-06-06 22:13:02 +0200
committerGabriele M <moto.falcon.git@gmail.com>2017-06-07 17:29:28 +0000
commit78666b57a88587e09178368b82140dc85424745d (patch)
tree070d9055fc445368ee4e17f284deb6b17b38004d
parentd8c3f8267202863975675c3c8a58afcec0003c8d (diff)
downloadandroid_packages_apps_Snap-78666b57a88587e09178368b82140dc85424745d.zip
android_packages_apps_Snap-78666b57a88587e09178368b82140dc85424745d.tar.gz
android_packages_apps_Snap-78666b57a88587e09178368b82140dc85424745d.tar.bz2
Snap: Simulate back button press when menu back button is pressed
Launching Gallery when the home button (shown as back button) is pressed makes no sense, especially because it's only shown in Snap's own gallery. In addition to that, if Gallery is disabled, Snap closes itself. Fix both the issues by simply simulating a back button press when the menu back button is pressed. REGRESSION-607 Change-Id: I0b2b6ee074715e2866bcebb009118b8271b1efdf
-rw-r--r--src/com/android/camera/CameraActivity.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 1bd452b..045e771 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1330,14 +1330,8 @@ public class CameraActivity extends Activity
// Handle presses on the action bar items
switch (item.getItemId()) {
case android.R.id.home:
- // ActionBar's Up/Home button was clicked
- try {
- startActivity(IntentHelper.getGalleryIntent(this));
- return true;
- } catch (ActivityNotFoundException e) {
- Log.w(TAG, "Failed to launch gallery activity, closing");
- finish();
- }
+ onBackPressed();
+ return true;
case R.id.action_delete:
UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
UsageStatistics.ACTION_DELETE, null, 0,