diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-01-24 20:57:03 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-01-24 20:57:03 +0100 |
commit | eed1f3de27e8330966c33a0339fde941c46e4a49 (patch) | |
tree | 2efd9b422666bfde17f4357621784dcd025e7128 | |
parent | 8ff28477ddadb2a0a803e84f92689231e04d544c (diff) |
ignore startService failure
some nokia devices with Android 9 fail to start the service from the activity sometimes. since this is probably a race it should be save to ignore this
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 65383c2aa..f5a1eac96 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -237,7 +237,11 @@ public abstract class XmppActivity extends ActionBarActivity { public void connectToBackend() { Intent intent = new Intent(this, XmppConnectionService.class); intent.setAction("ui"); - startService(intent); + try { + startService(intent); + } catch (IllegalStateException e) { + Log.w(Config.LOGTAG, "unable to start service from " + getClass().getSimpleName()); + } bindService(intent, mConnection, Context.BIND_AUTO_CREATE); } |