Prevent crash

This commit is contained in:
M66B
2021-03-24 18:55:18 +01:00
parent d0615fd488
commit e322d4f8bc
2 changed files with 10 additions and 3 deletions

View File

@@ -2433,7 +2433,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (isBackgroundService(context))
context.startService(intent);
else
ContextCompat.startForegroundService(context, intent);
try {
ContextCompat.startForegroundService(context, intent);
} catch (Throwable ex) {
Log.e(ex);
}
}
private static boolean isBackgroundService(Context context) {