From 67a41170dd301761fb3b80507640e7ce049b8c23 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 29 Apr 2018 15:33:44 +0200 Subject: catch run time exception when starting service from event receiver --- src/main/java/de/pixart/messenger/services/EventReceiver.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/de') diff --git a/src/main/java/de/pixart/messenger/services/EventReceiver.java b/src/main/java/de/pixart/messenger/services/EventReceiver.java index cdd1afe19..e4ec8cdb7 100644 --- a/src/main/java/de/pixart/messenger/services/EventReceiver.java +++ b/src/main/java/de/pixart/messenger/services/EventReceiver.java @@ -22,7 +22,11 @@ public class EventReceiver extends BroadcastReceiver { } final String action = intent.getAction(); if (action.equals("ui") || hasEnabledAccounts(context)) { - context.startService(mIntentForService); + try { + context.startService(mIntentForService); + } catch (RuntimeException e) { + Log.d(Config.LOGTAG, "EventReceiver was unable to start service"); + } } else { Log.d(Config.LOGTAG, "EventReceiver ignored action " + mIntentForService.getAction()); } -- cgit v1.2.3