QuickTileService: Fix crash opening activity
Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
parent
30901a6152
commit
f8ee7dcce9
@ -36,10 +36,13 @@ public class QuickTileService extends TileService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
if (tunnel != null)
|
if (tunnel != null) {
|
||||||
tunnel.setState(State.TOGGLE).whenComplete(this::onToggleFinished);
|
tunnel.setState(State.TOGGLE).whenComplete(this::onToggleFinished);
|
||||||
else
|
} else {
|
||||||
startActivityAndCollapse(new Intent(this, MainActivity.class));
|
final Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivityAndCollapse(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user