addAction

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

Adds an Action to an action category.

Calling addAction() more than once with the same category will add each Action to that category, allowing many actions to be attached to notification of that category.

Return

The same NotificationConfig.

Parameters

category

identifier of the action category

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(categoryName: String, @DrawableRes icon: Int, title: CharSequence, actionIntent: Intent?, remoteInput: RemoteInput?, flags: Int): NotificationConfig

Adds an Action to an action category.

Calling addAction() more than once with the same category will add each Action to that category, allowing many actions to be attached to notification of that category.

Return

The same NotificationConfig.

Parameters

categoryName

identifier of the action category

icon

icon to show for this action

title

the title of the action

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.