diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-10 11:13:16 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-10 11:13:16 -0600 |
commit | bb60a11982868f6e0234bb674f90f09346bd0dce (patch) | |
tree | be44b99e9aaeeda122faaf46dd05c80e10a14c79 /app/src/main/java/com/wireguard | |
parent | 24bd52ef5978a530878ed811107005f7d74bf146 (diff) |
QuickTileService: Fix crash opening activity
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r-- | app/src/main/java/com/wireguard/android/QuickTileService.java | 9 |
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 |