NotificationCompat.MessagingStyle.Message
个对象将时间戳作为参数,但使用NotificationCompat.MessagingStyle
创建的通知不会在任何地方显示此时间。这个论点的目的是什么?
NotificationCompat.MessagingStyle.Message message1 =
new NotificationCompat.MessagingStyle.Message(messages[0].getText(),
messages[0].getTime(),
messages[0].getSender());
NotificationCompat.MessagingStyle.Message message2 =
new NotificationCompat.MessagingStyle.Message(messages[1].getText(),
messages[1].getTime(),
messages[1].getSender());
Notification notification = new NotificationCompat.Builder(mContext, CHANNEL_ID)
.setSmallIcon(R.drawable.new_message)
.setStyle(new NotificationCompat.MessagingStyle(resources.getString(R.string.reply_name))
.addMessage(message1)
.addMessage(message2))
.build()