diff options
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java | 6 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsKeyServerActivity.java | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java index 21d0f1dbd..eb9ee05af 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java @@ -77,7 +77,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { String action = getIntent().getAction(); - if (action != null && action.equals(ACTION_PREFS_CLOUD)) { + if (ACTION_PREFS_CLOUD.equals(action)) { addPreferencesFromResource(R.xml.cloud_search_prefs); mKeyServerPreference = (PreferenceScreen) findPreference(Constants.Pref.KEY_SERVERS); @@ -100,7 +100,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { (SwitchPreference) findPreference(Constants.Pref.SEARCH_KEYBASE) ); - } else if (action != null && action.equals(ACTION_PREFS_ADV)) { + } else if (ACTION_PREFS_ADV.equals(action)) { addPreferencesFromResource(R.xml.passphrase_preferences); initializePassphraseCacheSubs( @@ -115,7 +115,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { initializeUseNumKeypadForYubiKeyPin( (CheckBoxPreference) findPreference(Constants.Pref.USE_NUMKEYPAD_FOR_YUBIKEY_PIN)); - } else if (action != null && action.equals(ACTION_PREFS_GUI)) { + } else if (ACTION_PREFS_GUI.equals(action)) { addPreferencesFromResource(R.xml.gui_preferences); initializeTheme((ListPreference) findPreference(Constants.Pref.THEME)); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsKeyServerActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsKeyServerActivity.java index f61ada84f..7dd92c45f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsKeyServerActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsKeyServerActivity.java @@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui; import android.content.Intent; import android.os.Bundle; +import android.view.MenuItem; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.ui.base.BaseActivity; @@ -34,6 +35,19 @@ public class SettingsKeyServerActivity extends BaseActivity { Intent intent = getIntent(); String servers[] = intent.getStringArrayExtra(EXTRA_KEY_SERVERS); loadFragment(savedInstanceState, servers); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + return super.onOptionsItemSelected(item); } @Override |