summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/browser')
-rw-r--r--src/com/android/browser/BrowserPreferencesPage.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java
index c47675d..2b42951 100644
--- a/src/com/android/browser/BrowserPreferencesPage.java
+++ b/src/com/android/browser/BrowserPreferencesPage.java
@@ -18,8 +18,11 @@ package com.android.browser;
import com.android.browser.preferences.DebugPreferencesFragment;
+import android.app.ActionBar;
+import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
+import android.view.MenuItem;
import java.util.List;
@@ -27,6 +30,17 @@ public class BrowserPreferencesPage extends PreferenceActivity {
public static final String CURRENT_PAGE = "currentPage";
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ ActionBar actionBar = getActionBar();
+ if (actionBar != null) {
+ actionBar.setDisplayOptions(
+ ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
+ }
+ }
+
/**
* Populate the activity with the top-level headers.
*/
@@ -51,4 +65,19 @@ public class BrowserPreferencesPage extends PreferenceActivity {
getApplicationContext(),
PreferenceManager.getDefaultSharedPreferences(this));
}
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ if (getFragmentManager().countBackStackEntries() > 0) {
+ getFragmentManager().popBackStack();
+ } else {
+ finish();
+ }
+ return true;
+ }
+
+ return false;
+ }
}