1
我想知道如何在通知面板中存在的分隔線下面繪製通知。正如您在此圖片中看到的,Google即時在那裏發佈通知。 FB Messenger聊天頭通知也在那裏。 我查看了文檔並嘗試了Categories,Priority和Visibility的各種組合,但都沒有成功。Android - 分隔線下方的通知
有什麼想法?
我想知道如何在通知面板中存在的分隔線下面繪製通知。正如您在此圖片中看到的,Google即時在那裏發佈通知。 FB Messenger聊天頭通知也在那裏。 我查看了文檔並嘗試了Categories,Priority和Visibility的各種組合,但都沒有成功。Android - 分隔線下方的通知
有什麼想法?
當你建立通知,設定優先PRIORITY_MIN
。
例子:
NotificationCompat.Builder nb = new NotificationCompat.Builder(this)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setContentTitle(mNotificationTitle)
.setPriority(Notification.PRIORITY_MIN)
.setContentIntent(launchSettingsIntent)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setSmallIcon(R.drawable.ic_notification);
不,不這樣做。至少在我的設備上。無論如何,謝謝你的回覆。 – pedronveloso
它適用於我的Nexus 6P,Nexus 7和Nexus 5,全部都在棉花糖上。哪些是你的設備? – 323go
你是對的,這實際上是我的錯。有用!謝謝:) – pedronveloso