From eed1f3de27e8330966c33a0339fde941c46e4a49 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 24 Jan 2019 20:57:03 +0100 Subject: 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 --- src/main/java/de/pixart/messenger/ui/XmppActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/ui/XmppActivity.java') 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); } -- cgit v1.2.3