From 38089f6c4222ab56582899f1f228966c5ebf75e8 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Tue, 11 Jan 2011 16:55:58 -0800 Subject: [PATCH] Show the UP arrow on account settings Show the UP arrow on the action bar. Tapping it works as a back press for now. Bug 3341634 Change-Id: I9fade234fd9878f701a601f4d016778fa032383b --- .../email/activity/setup/AccountSettingsXL.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/android/email/activity/setup/AccountSettingsXL.java b/src/com/android/email/activity/setup/AccountSettingsXL.java index b84bec8ac..cad9b35aa 100644 --- a/src/com/android/email/activity/setup/AccountSettingsXL.java +++ b/src/com/android/email/activity/setup/AccountSettingsXL.java @@ -28,6 +28,7 @@ import com.android.email.provider.EmailContent; import com.android.email.provider.EmailContent.Account; import com.android.email.provider.EmailContent.AccountColumns; +import android.app.ActionBar; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -161,6 +162,9 @@ public class AccountSettingsXL extends PreferenceActivity { } } mShowDebugMenu = i.getBooleanExtra(EXTRA_ENABLE_DEBUG, false); + + getActionBar().setDisplayOptions( + ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP); } @Override @@ -222,6 +226,13 @@ public class AccountSettingsXL extends PreferenceActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { + case android.R.id.home: + // The app icon on the action bar is pressed. Just emulate a back press. + // TODO: this should navigate to the main screen, even if a sub-setting is open. + // But we shouldn't just finish(), as we want to show "discard changes?" dialog + // when necessary. + onBackPressed(); + break; case R.id.add_new_account: onAddNewAccount(); break;