From cff23926ac5c835f4fa53cedc83f7d9bd240f49e Mon Sep 17 00:00:00 2001 From: moving-bits Date: Sat, 18 Feb 2023 21:00:50 +0100 Subject: [PATCH] Use NotificationCompat for API < 26 compatibility (fix #364) --- .../menion/android/whereyougo/utils/NotificationService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/menion/android/whereyougo/utils/NotificationService.java b/src/main/java/menion/android/whereyougo/utils/NotificationService.java index c2b095e7..771a7a95 100644 --- a/src/main/java/menion/android/whereyougo/utils/NotificationService.java +++ b/src/main/java/menion/android/whereyougo/utils/NotificationService.java @@ -12,6 +12,8 @@ import android.os.Build; import android.os.IBinder; +import androidx.core.app.NotificationCompat; + public class NotificationService extends Service { private static final int notification_id = 10; private static final String NOTIFICATION_CHANNEL_ID = "menion.android.whereyougo.utils.NotificationService"; @@ -78,7 +80,7 @@ private void startNotificationService(boolean background) { PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); - Notification.Builder builder = new Notification.Builder(this, NOTIFICATION_CHANNEL_ID); + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID); builder.setContentTitle(contentTitel); builder.setSmallIcon(R.drawable.ic_title_logo_transparent); builder.setContentIntent(pendingIntent);