summaryrefslogtreecommitdiffhomepage
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/wireguard/android/ConfigActivity.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/ConfigActivity.java b/app/src/main/java/com/wireguard/android/ConfigActivity.java
index 4a19c681..084f6c08 100644
--- a/app/src/main/java/com/wireguard/android/ConfigActivity.java
+++ b/app/src/main/java/com/wireguard/android/ConfigActivity.java
@@ -35,6 +35,8 @@ public class ConfigActivity extends BaseConfigActivity {
isEditing = false;
else
setCurrentConfig(null);
+ if (!isSplitLayout && fm.getBackStackEntryCount() == 0 && getActionBar() != null)
+ getActionBar().setDisplayHomeAsUpEnabled(false);
}
@Override
@@ -80,6 +82,9 @@ public class ConfigActivity extends BaseConfigActivity {
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
+ case android.R.id.home:
+ onBackPressed();
+ return true;
case R.id.menu_action_edit:
switchToFragment(mainContainer, TAG_EDIT, true);
isEditing = true;
@@ -168,6 +173,8 @@ public class ConfigActivity extends BaseConfigActivity {
if (push) {
transaction.addToBackStack(null);
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
+ if (!isSplitLayout && getActionBar() != null)
+ getActionBar().setDisplayHomeAsUpEnabled(true);
}
transaction.replace(container, fragment, null).commit();
}