ignore startService failure

Daniel Gultsch created

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

Change summary

src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/ui/XmppActivity.java 🔗

@@ -217,7 +217,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);
 	}