2017-12-21 13 views
1

通知優先度をmaxに設定しましたが、それでも通知領域の下部にあります。notification.setPriorityが機能しない

マイコード:

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

、それがどのように見えるか:アンドロイドドキュメントから

enter image description here

答えて

0

PRIORITY_MAXは、APIレベルの代わりに26 そこで使用IMPORTANCE_HIGHで廃止されました。

+1

いいえ、私のデバイスには23のAPIレベルがあります –

+0

この投稿をチェックしてください:-https://stackoverflow.com/questions/12758681/android-how-can-i-put-my-notification-on-top- of-notification-area –

+0

私はすでにこの答えで正確にどのようにコードを持っていますが、動作しません。 –

関連する問題