2017-12-21 2 views
1

Ich setze die Benachrichtigung Priorität auf max, aber es ist immer noch am unteren Rand des Infobereichs.notification.setPriority funktioniert nicht

Mein 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()); 

Wie es aussieht:

enter image description here

Antwort

0

aus dem Android-Dokumentation:

PRIORITY_MAX wurde in API-Ebene veraltet 26. Daher Verwenden IMPORTANCE_HIGH statt.

+1

Nein, ich habe 23 API-Ebene auf meinem Gerät –

+0

überprüfen Sie diesen Beitrag: -https: //stackoverflow.com/questions/12758681/android-how-can-i-put-my-notification-on-top- of-notification-area –

+0

Ich habe bereits Code genau wie in dieser Antwort, aber es funktioniert nicht :( –