belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
NotificationCompat.Action
public
static
class
NotificationCompat.Action
extends Object
java.lang.Object | |
↳ | android.support.v4.app.NotificationCompat.Action |
Structure to encapsulate a named action that can be shown as part of this notification.
It must include an icon, a label, and a PendingIntent
to be fired when the action is
selected by the user. Action buttons won't appear on platforms prior to Android 4.1.
Apps should use addAction(int, CharSequence, PendingIntent)
or addAction(NotificationCompat.Action)
to attach actions.
Summary
Nested classes | |
---|---|
class |
NotificationCompat.Action.Builder
Builder class for |
interface |
NotificationCompat.Action.Extender
Extender interface for use with |
@interface |
NotificationCompat.Action.SemanticAction
Provides meaning to an |
class |
NotificationCompat.Action.WearableExtender
Wearable extender for notification actions. |
Fields | |
---|---|
public
PendingIntent |
actionIntent
Intent to send when the user invokes this action. |
public
int |
icon
Small icon representing the action. |
public
CharSequence |
title
Title of the action. |
Public constructors | |
---|---|
NotificationCompat.Action(int icon, CharSequence title, PendingIntent intent)
|
Public methods | |
---|---|
PendingIntent
|
getActionIntent()
|
boolean
|
getAllowGeneratedReplies()
Return whether the platform should automatically generate possible replies for this
|
RemoteInput[]
|
getDataOnlyRemoteInputs()
Get the list of inputs to be collected from the user that ONLY accept data when this action is sent. |
Bundle
|
getExtras()
Get additional metadata carried around with this Action. |
int
|
getIcon()
|
RemoteInput[]
|
getRemoteInputs()
Get the list of inputs to be collected from the user when this action is sent. |
int
|
getSemanticAction()
Returns the |
boolean
|
getShowsUserInterface()
Return whether or not triggering this |
CharSequence
|
getTitle()
|
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Constants
SEMANTIC_ACTION_ARCHIVE
int SEMANTIC_ACTION_ARCHIVE
NotificationCompat.Action.SemanticAction
: Archive the content associated with the notification. This
could mean archiving an email, message, etc.
Constant Value: 5 (0x00000005)
SEMANTIC_ACTION_CALL
int SEMANTIC_ACTION_CALL
NotificationCompat.Action.SemanticAction
: Call a contact, group, etc.
Constant Value: 10 (0x0000000a)
SEMANTIC_ACTION_DELETE
int SEMANTIC_ACTION_DELETE
NotificationCompat.Action.SemanticAction
: Delete the content associated with the notification. This
could mean deleting an email, message, etc.
Constant Value: 4 (0x00000004)
SEMANTIC_ACTION_MARK_AS_READ
int SEMANTIC_ACTION_MARK_AS_READ
NotificationCompat.Action.SemanticAction
: Mark content as read.
Constant Value: 2 (0x00000002)
SEMANTIC_ACTION_MARK_AS_UNREAD
int SEMANTIC_ACTION_MARK_AS_UNREAD
NotificationCompat.Action.SemanticAction
: Mark content as unread.
Constant Value: 3 (0x00000003)
SEMANTIC_ACTION_MUTE
int SEMANTIC_ACTION_MUTE
NotificationCompat.Action.SemanticAction
: Mute the content associated with the notification. This could
mean silencing a conversation or currently playing media.
Constant Value: 6 (0x00000006)
SEMANTIC_ACTION_NONE
int SEMANTIC_ACTION_NONE
NotificationCompat.Action.SemanticAction
: No semantic action defined.
Constant Value: 0 (0x00000000)
SEMANTIC_ACTION_REPLY
int SEMANTIC_ACTION_REPLY
NotificationCompat.Action.SemanticAction
: Reply to a conversation, chat, group, or wherever replies
may be appropriate.
Constant Value: 1 (0x00000001)
SEMANTIC_ACTION_THUMBS_DOWN
int SEMANTIC_ACTION_THUMBS_DOWN
NotificationCompat.Action.SemanticAction
: Mark content with a thumbs down.
Constant Value: 9 (0x00000009)
SEMANTIC_ACTION_THUMBS_UP
int SEMANTIC_ACTION_THUMBS_UP
NotificationCompat.Action.SemanticAction
: Mark content with a thumbs up.
Constant Value: 8 (0x00000008)
SEMANTIC_ACTION_UNMUTE
int SEMANTIC_ACTION_UNMUTE
NotificationCompat.Action.SemanticAction
: Unmute the content associated with the notification. This could
mean un-silencing a conversation or currently playing media.
Constant Value: 7 (0x00000007)
Fields
actionIntent
PendingIntent actionIntent
Intent to send when the user invokes this action. May be null, in which case the action may be rendered in a disabled presentation.
Public constructors
NotificationCompat.Action
NotificationCompat.Action (int icon, CharSequence title, PendingIntent intent)
Parameters | |
---|---|
icon |
int |
title |
CharSequence |
intent |
PendingIntent |
Public methods
getAllowGeneratedReplies
boolean getAllowGeneratedReplies ()
Return whether the platform should automatically generate possible replies for this
NotificationCompat.Action
Returns | |
---|---|
boolean |
getDataOnlyRemoteInputs
RemoteInput[] getDataOnlyRemoteInputs ()
Get the list of inputs to be collected from the user that ONLY accept data when this
action is sent. These remote inputs are guaranteed to return true on a call to
isDataOnly()
.
May return null if no data-only remote inputs were added.
This method exists so that legacy RemoteInput collectors that pre-date the addition of non-textual RemoteInputs do not access these remote inputs.
Returns | |
---|---|
RemoteInput[] |
getExtras
Bundle getExtras ()
Get additional metadata carried around with this Action.
Returns | |
---|---|
Bundle |
getRemoteInputs
RemoteInput[] getRemoteInputs ()
Get the list of inputs to be collected from the user when this action is sent.
May return null if no remote inputs were added. Only returns inputs which accept
a text input. For inputs which only accept data use getDataOnlyRemoteInputs()
.
Returns | |
---|---|
RemoteInput[] |
getSemanticAction
int getSemanticAction ()
Returns the NotificationCompat.Action.SemanticAction
associated with this NotificationCompat.Action
. A
NotificationCompat.Action.SemanticAction
denotes what an NotificationCompat.Action
's PendingIntent
will do
(eg. reply, mark as read, delete, etc).
Returns | |
---|---|
int |
See also:
getShowsUserInterface
boolean getShowsUserInterface ()
Return whether or not triggering this NotificationCompat.Action
's PendingIntent
will open a
user interface.
Returns | |
---|---|
boolean |
Annotations
Interfaces
- ActionBarDrawerToggle.Delegate
- ActionBarDrawerToggle.DelegateProvider
- ActivityCompat.OnRequestPermissionsResultCallback
- ActivityCompat.PermissionCompatDelegate
- FragmentManager.BackStackEntry
- FragmentManager.OnBackStackChangedListener
- LoaderManager.LoaderCallbacks
- NotificationCompat.Action.Extender
- NotificationCompat.Extender
- SharedElementCallback.OnSharedElementsReadyListener
- TaskStackBuilder.SupportParentable
Classes
- ActionBarDrawerToggle
- ActivityCompat
- ActivityManagerCompat
- ActivityOptionsCompat
- AlarmManagerCompat
- AppLaunchChecker
- AppOpsManagerCompat
- BundleCompat
- DialogFragment
- Fragment
- Fragment.SavedState
- FragmentActivity
- FragmentContainer
- FragmentController
- FragmentHostCallback
- FragmentManager
- FragmentManager.FragmentLifecycleCallbacks
- FragmentManagerNonConfig
- FragmentPagerAdapter
- FragmentStatePagerAdapter
- FragmentTabHost
- FragmentTransaction
- FrameMetricsAggregator
- JobIntentService
- ListFragment
- LoaderManager
- NavUtils
- NotificationCompat
- NotificationCompat.Action
- NotificationCompat.Action.Builder
- NotificationCompat.Action.WearableExtender
- NotificationCompat.BigPictureStyle
- NotificationCompat.BigTextStyle
- NotificationCompat.Builder
- NotificationCompat.CarExtender
- NotificationCompat.CarExtender.UnreadConversation
- NotificationCompat.CarExtender.UnreadConversation.Builder
- NotificationCompat.DecoratedCustomViewStyle
- NotificationCompat.InboxStyle
- NotificationCompat.MessagingStyle
- NotificationCompat.MessagingStyle.Message
- NotificationCompat.Style
- NotificationCompat.WearableExtender
- NotificationCompatExtras
- NotificationCompatSideChannelService
- NotificationManagerCompat
- RemoteInput
- RemoteInput.Builder
- ServiceCompat
- ShareCompat
- ShareCompat.IntentBuilder
- ShareCompat.IntentReader
- SharedElementCallback
- TaskStackBuilder
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.