QuickTileService: Fix crash opening activity

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2018-01-10 11:13:16 -06:00
parent 30901a6152
commit f8ee7dcce9

View File

@ -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