summaryrefslogtreecommitdiffstats
path: root/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'photoviewer/src/com/android/ex/photo/PhotoViewActivity.java')
-rw-r--r--photoviewer/src/com/android/ex/photo/PhotoViewActivity.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java b/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
index 54feada..b060f28 100644
--- a/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
+++ b/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
@@ -31,6 +31,7 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.ViewPager.OnPageChangeListener;
+import android.view.MenuItem;
import android.view.View;
import com.android.ex.photo.PhotoViewPager.InterceptType;
@@ -236,6 +237,16 @@ public class PhotoViewActivity extends Activity implements
outState.putBoolean(STATE_FULLSCREEN_KEY, mFullScreen);
}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ finish();
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
public void addScreenListener(OnScreenListener listener) {
mScreenListeners.add(listener);
}