Skip to content

Commit

Permalink
Use NotificationCompat for API < 26 compatibility (fix cgeo#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
moving-bits committed Feb 18, 2023
1 parent 3442a7b commit cff2392
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cff2392

Please sign in to comment.