summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r--app/src/main/java/com/wireguard/android/activity/MainActivity.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/activity/MainActivity.java b/app/src/main/java/com/wireguard/android/activity/MainActivity.java
index ab9a4f8a..0a1dc0be 100644
--- a/app/src/main/java/com/wireguard/android/activity/MainActivity.java
+++ b/app/src/main/java/com/wireguard/android/activity/MainActivity.java
@@ -53,7 +53,16 @@ public class MainActivity extends BaseActivity
setSelectedTunnel(null);
return;
}
- super.onBackPressed();
+ if (isTaskRoot()) {
+ // @{link TunnelDetailFragment} is in foreground
+ if (backStackEntries == 2) {
+ getSupportFragmentManager().popBackStack();
+ } else if (backStackEntries == 0) {
+ finishAfterTransition();
+ }
+ } else {
+ super.onBackPressed();
+ }
}
@Override public void onBackStackChanged() {