summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/com/wireguard/android/QuickTileService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java
index e694af4e..f23eb4ba 100644
--- a/app/src/main/java/com/wireguard/android/QuickTileService.java
+++ b/app/src/main/java/com/wireguard/android/QuickTileService.java
@@ -36,10 +36,13 @@ public class QuickTileService extends TileService {
@Override
public void onClick() {
- if (tunnel != null)
+ if (tunnel != null) {
tunnel.setState(State.TOGGLE).whenComplete(this::onToggleFinished);
- else
- startActivityAndCollapse(new Intent(this, MainActivity.class));
+ } else {
+ final Intent intent = new Intent(this, MainActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivityAndCollapse(intent);
+ }
}
@Override