From 6af4af42f54d46190f2fb7f2a700f829a8f1a732 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 9 May 2020 01:27:57 +0200 Subject: catch IllegalStateException when app is not in a state that allows to start the provider API service --- app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java b/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java index 65d01b22..04a53a47 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java @@ -40,7 +40,11 @@ public class ProviderAPICommand { private void execute() { if (isInitialized()) { Intent intent = setUpIntent(); - context.startService(intent); + try { + context.startService(intent); + } catch (IllegalStateException e) { + e.printStackTrace(); + } } } -- cgit v1.2.3