2017-12-21 3 views
1

알림 우선 순위를 최대로 설정했지만 여전히 알림 영역의 맨 아래에 있습니다.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

이미이 답변에는 코드가 정확히 있지만 작동하지 않습니다. –

관련 문제