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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user