Most visited

Recently visited

Added in API level 20

Notification.Action.Builder

public static final class Notification.Action.Builder
extends Object

java.lang.Object
   ↳ android.app.Notification.Action.Builder


Notification.Action对象的生成器类。

Summary

Public constructors

Notification.Action.Builder(int icon, CharSequence title, PendingIntent intent)

构建 Notification.Action对象的新构建器。

Notification.Action.Builder(Icon icon, CharSequence title, PendingIntent intent)

构建 Notification.Action对象的新构建器。

Notification.Action.Builder(Notification.Action action)

构造一个新的建设者 Notification.Action使用领域从对象 Notification.Action

Public methods

Notification.Action.Builder addExtras(Bundle extras)

将其他元数据合并到此构建器中。

Notification.Action.Builder addRemoteInput(RemoteInput remoteInput)

添加要在发送此操作时从用户收集的输入。

Notification.Action build()

组合所有已设置的选项并返回一个新的 Notification.Action对象。

Notification.Action.Builder extend(Notification.Action.Extender extender)

将扩展程序应用于此操作构建器。

Bundle getExtras()

获取此构建器使用的元数据包。

Notification.Action.Builder setAllowGeneratedReplies(boolean allowGeneratedReplies)

设置平台是否应自动生成可能的答复以添加到 getChoices()

Inherited methods

From class java.lang.Object

Public constructors

Notification.Action.Builder

Added in API level 20
Notification.Action.Builder (int icon, 
                CharSequence title, 
                PendingIntent intent)

构建 Notification.Action对象的新构建器。

Parameters
icon int: icon to show for this action
title CharSequence: the title of the action
intent PendingIntent: the PendingIntent to fire when users trigger this action

Notification.Action.Builder

Added in API level 23
Notification.Action.Builder (Icon icon, 
                CharSequence title, 
                PendingIntent intent)

构建 Notification.Action对象的新构建器。

Parameters
icon Icon: icon to show for this action
title CharSequence: the title of the action
intent PendingIntent: the PendingIntent to fire when users trigger this action

Notification.Action.Builder

Added in API level 20
Notification.Action.Builder (Notification.Action action)

构造一个新的建设者 Notification.Action使用领域从对象 Notification.Action

Parameters
action Notification.Action: the action to read fields from.

Public methods

addExtras

Added in API level 20
Notification.Action.Builder addExtras (Bundle extras)

将其他元数据合并到此构建器中。

Bundle中的值将替换此Builder中现有的额外值。

Parameters
extras Bundle
Returns
Notification.Action.Builder

也可以看看:

addRemoteInput

Added in API level 20
Notification.Action.Builder addRemoteInput (RemoteInput remoteInput)

添加要在发送此操作时从用户收集的输入。 可以使用getResultsFromIntent(Intent)函数从启动的意图中检索响应值。

Parameters
remoteInput RemoteInput: a RemoteInput to add to the action
Returns
Notification.Action.Builder this object for method chaining

build

Added in API level 20
Notification.Action build ()

组合所有已设置的选项并返回一个新的 Notification.Action对象。

Returns
Notification.Action the built action

extend

Added in API level 20
Notification.Action.Builder extend (Notification.Action.Extender extender)

将扩展程序应用于此操作构建器。 扩展器可用于在此构建器上添加元数据或更改选项。

Parameters
extender Notification.Action.Extender
Returns
Notification.Action.Builder

getExtras

Added in API level 20
Bundle getExtras ()

获取此构建器使用的元数据包。

返回的Bundle与此Builder共享。

Returns
Bundle

setAllowGeneratedReplies

Added in API level 24
Notification.Action.Builder setAllowGeneratedReplies (boolean allowGeneratedReplies)

设置平台是否应自动生成可能的答复以添加到getChoices() 如果Notification.Action没有RemoteInput ,则不起作用。

Parameters
allowGeneratedReplies boolean: true to allow generated replies, false otherwise
Returns
Notification.Action.Builder this object for method chaining The default value is false

Hooray!