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
This commit is contained in:
Daniel Gultsch 2019-01-09 18:30:25 +01:00
parent 25856992d1
commit 459db1a0a3

View file

@ -217,7 +217,11 @@ public abstract class XmppActivity extends ActionBarActivity {
public void connectToBackend() { public void connectToBackend() {
Intent intent = new Intent(this, XmppConnectionService.class); Intent intent = new Intent(this, XmppConnectionService.class);
intent.setAction("ui"); 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); bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
} }