addAction

fun addAction(@DrawableRes icon: Int, title: CharSequence, actionIntent: Intent?, flags: Int): NotificationCategory

Adds an Action to an action category. Note: Actions with duplicate titles will be ignored

Parameters

icon

icon to show for this action

title

the title of the action

actionIntent

the Intent to fire when users trigger this action

flags

May be FLAG_ONE_SHOT, FLAG_NO_CREATE, FLAG_CANCEL_CURRENT, FLAG_UPDATE_CURRENT, FLAG_IMMUTABLE or any of the flags as supported by Intent.fillIn() to control which unspecified parts of the intent that can be supplied when the actual send happens. Used for building the Action's PendingIntent.


fun addAction(@DrawableRes icon: Int, title: CharSequence, actionIntent: Intent?, remoteInput: RemoteInput?, flags: Int): NotificationCategory

Adds an Action to an action category. Note: Actions with duplicate titles will be ignored

Parameters

icon

icon to show for this action

title

the title of the action, must be unique per category

actionIntent

the Intent to fire when users trigger this action

remoteInput

a RemoteInput to add to the action

flags

May be FLAG_ONE_SHOT, FLAG_NO_CREATE, FLAG_CANCEL_CURRENT, FLAG_UPDATE_CURRENT, FLAG_IMMUTABLE or any of the flags as supported by Intent.fillIn() to control which unspecified parts of the intent that can be supplied when the actual send happens. Used for building the Action's PendingIntent.