summaryrefslogtreecommitdiffhomepage
path: root/app/src
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-10 11:13:16 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-10 11:13:16 -0600
commitf8ee7dcce9748577aebef6677f9e6974c2dac03e (patch)
treebe44b99e9aaeeda122faaf46dd05c80e10a14c79 /app/src
parent30901a6152614d7aa1fa89d56372f7b362b74b25 (diff)
QuickTileService: Fix crash opening activity
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src')
-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