AI-generated Key Takeaways
-
NotificationAction represents an action in the media notification and can be either pre-defined or custom.
-
NotificationAction.Builder is used to create a NotificationAction.
-
Creating a pre-defined action requires only setting the action string.
-
Creating a custom action requires setting the action string, icon resource ID, and content description.
-
The class includes methods to retrieve the action string, content description, and icon resource ID.
An object representing an action in the media notification. Note that it can be either a
pre-defined action or a custom action. To create an action, use
NotificationAction.Builder. If the action is a pre-defined action, only
NotificationAction.Builder.setAction(String) needs to be called. See
MediaIntentReceiver for the list of pre-defined actions. If the action is a custom
action, call
NotificationAction.Builder.setAction(String) to set the action,
NotificationAction.Builder.setIconResId(int) to set the icon's resource ID, and
NotificationAction.Builder.setContentDescription(String) to set the content
description for accessibility.
Nested Class Summary
| class | NotificationAction.Builder | A builder for
NotificationAction. |
|
Inherited Constant Summary
Public Method Summary
| String |
getAction()
Returns the intent action.
|
| String |
getContentDescription()
Returns the content description that is used for accessibility.
|
| int |
getIconResId()
Returns the icon's resource ID.
|
| void |
writeToParcel(Parcel dest, int
flags)
|
Inherited Method Summary
Public Methods
public String getAction ()
Returns the intent action.
public String getContentDescription ()
Returns the content description that is used for accessibility.
public int getIconResId ()
Returns the icon's resource ID.