public static final class NotificationCompat.Action.Builder extends Object
NotificationCompat.Action
objects.Constructor and Description |
---|
Builder(int icon,
CharSequence title,
PendingIntent intent)
Construct a new builder for
NotificationCompat.Action object. |
Builder(NotificationCompat.Action action)
Construct a new builder for
NotificationCompat.Action object using the fields from an
NotificationCompat.Action . |
Modifier and Type | Method and Description |
---|---|
NotificationCompat.Action.Builder |
addExtras(Bundle extras)
Merge additional metadata into this builder.
|
NotificationCompat.Action.Builder |
addRemoteInput(RemoteInput remoteInput)
Add an input to be collected from the user when this action is sent.
|
NotificationCompat.Action |
build()
Combine all of the options that have been set and return a new
NotificationCompat.Action
object. |
NotificationCompat.Action.Builder |
extend(NotificationCompat.Action.Extender extender)
Apply an extender to this action builder.
|
Bundle |
getExtras()
Get the metadata Bundle used by this Builder.
|
NotificationCompat.Action.Builder |
setAllowGeneratedReplies(boolean allowGeneratedReplies)
Set whether the platform should automatically generate possible replies to add to
RemoteInput.getChoices() . |
public Builder(int icon, CharSequence title, PendingIntent intent)
NotificationCompat.Action
object.icon
- icon to show for this actiontitle
- the title of the actionintent
- the PendingIntent
to fire when users trigger this actionpublic Builder(NotificationCompat.Action action)
NotificationCompat.Action
object using the fields from an
NotificationCompat.Action
.action
- the action to read fields from.public NotificationCompat.Action.Builder addExtras(Bundle extras)
Values within the Bundle will replace existing extras values in this Builder.
NotificationCompat.Action.getExtras()
public Bundle getExtras()
The returned Bundle is shared with this Builder.
public NotificationCompat.Action.Builder addRemoteInput(RemoteInput remoteInput)
RemoteInput.getResultsFromIntent(android.content.Intent)
function.remoteInput
- a RemoteInput
to add to the actionpublic NotificationCompat.Action.Builder setAllowGeneratedReplies(boolean allowGeneratedReplies)
RemoteInput.getChoices()
. If the NotificationCompat.Action
doesn't have a
RemoteInput
, this has no effect.allowGeneratedReplies
- true
to allow generated replies, false
otherwisefalse
public NotificationCompat.Action.Builder extend(NotificationCompat.Action.Extender extender)
public NotificationCompat.Action build()
NotificationCompat.Action
object.