【发布时间】:2020-12-27 15:56:50
【问题描述】:
我真的迷路了。是否存在隐藏状态栏中的通知图标但通知仍然存在于抽屉中的情况?在回复现有通知后将传入消息附加到通知时会发生这种情况。
我用:
NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification();
一切正常,但通知图标隐藏。我也用
NotificationManager.IMPORTANCE_HIGH
这是通知生成器代码。
NotificationCompat.MessagingStyle activeNotification = NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification();
return new NotificationCompat.Builder(getApplicationContext(), ID)
.setContentIntent(pIntent)
.addAction(action)
.setSmallIcon( R.drawable.icon)
.setAutoCancel(true)
.setSound(uri)
.setStyle(activeNotification
.addMessage(body, SystemClock.currentThreadTimeMillis(), person)
)
;
提前致谢。
【问题讨论】:
标签: android push-notification android-notifications android-statusbar google-people-api