diff --git a/src/android/ForegroundService.java b/src/android/ForegroundService.java index 80223e0..c0edae6 100644 --- a/src/android/ForegroundService.java +++ b/src/android/ForegroundService.java @@ -196,11 +196,16 @@ public class ForegroundService extends Service { Intent intent = context.getPackageManager() .getLaunchIntentForPackage(pkgName); + int smallIcon = getIconResId(settings); + if (smallIcon == 0) { //If no icon at all was found, fall back to the app's icon + smallIcon = context.getApplicationInfo().icon; + } + NotificationCompat.Builder notification = new NotificationCompat.Builder(context, CHANNEL_ID) .setContentTitle(title) .setContentText(text) .setOngoing(true) - .setSmallIcon(getIconResId(settings)) + .setSmallIcon(smallIcon) .setShowWhen(settings.optBoolean("showWhen", true)); if (!subText.equals("")) {