2

I set the notification priority to max, but it is still at the bottom of the notification area.

My code:

NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
            .setCustomContentView(views)
            .setSmallIcon(R.drawable.ic_play_24dp)
            .setOngoing(true)
            .setPriority(NotificationCompat.PRIORITY_MAX)
            .setContentIntent(notification);
notificationmanager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationmanager.notify(0, builder.build());

How it looks:

enter image description here

Andrew Morton
  • 24,203
  • 9
  • 60
  • 84

1 Answers1

0

From the android documentation :

PRIORITY_MAX was deprecated in API level 26. Therefore Use IMPORTANCE_HIGH instead.

gautam
  • 1,701
  • 2
  • 17
  • 33