MessagingStyle.Message时间戳有什么用途?

时间:2018-06-18 16:05:18

标签: android push-notification notifications

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

0 个答案:

没有答案