Most visited

Recently visited

Added in API level 16

Notification.InboxStyle

public static class Notification.InboxStyle
extends Notification.Style

java.lang.Object
   ↳ android.app.Notification.Style
     ↳ android.app.Notification.InboxStyle


Helper类用于生成包含(最多5个)字符串列表的大型通知。 以下是您如何设置通知上的InboxStyle的方法:

 Notification notif = new Notification.Builder(mContext)
     .setContentTitle("5 New mails from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_mail)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.InboxStyle()
         .addLine(str1)
         .addLine(str2)
         .setContentTitle("")
         .setSummaryText("+3 more"))
     .build();
 

也可以看看:

Summary

Inherited fields

From class android.app.Notification.Style

Public constructors

Notification.InboxStyle()
Notification.InboxStyle(Notification.Builder builder)

此构造函数在API级别24中已弃用。请使用InboxStyle()

Public methods

Notification.InboxStyle addLine(CharSequence cs)

将一行添加到收件箱通知的摘要部分。

Notification.InboxStyle setBigContentTitle(CharSequence title)

覆盖模板大表单中的ContentTitle。

Notification.InboxStyle setSummaryText(CharSequence cs)

将详细信息部分的第一行设置为模板的大表格。

Inherited methods

From class android.app.Notification.Style
From class java.lang.Object

Public constructors

Notification.InboxStyle

Added in API level 16
Notification.InboxStyle ()

Notification.InboxStyle

Added in API level 16
Notification.InboxStyle (Notification.Builder builder)

此构造函数在API级别24中已被弃用。
使用InboxStyle()

Parameters
builder Notification.Builder

Public methods

addLine

Added in API level 16
Notification.InboxStyle addLine (CharSequence cs)

将一行添加到收件箱通知的摘要部分。

Parameters
cs CharSequence
Returns
Notification.InboxStyle

setBigContentTitle

Added in API level 16
Notification.InboxStyle setBigContentTitle (CharSequence title)

覆盖模板大表单中的ContentTitle。 这默认为传递给setContentTitle()的值。

Parameters
title CharSequence
Returns
Notification.InboxStyle

setSummaryText

Added in API level 16
Notification.InboxStyle setSummaryText (CharSequence cs)

将详细信息部分的第一行设置为模板的大表格。

Parameters
cs CharSequence
Returns
Notification.InboxStyle

Hooray!