Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

RemoteActionCompat

class RemoteActionCompat
kotlin.Any
   ↳ androidx.core.app.RemoteActionCompat

Represents a remote action that can be called from another process. The action can have an associated visualization including metadata like an icon or title.

This is a backward-compatible version of RemoteAction.

Summary

Public constructors
<init>(@NonNull icon: IconCompat, @NonNull title: CharSequence, @NonNull contentDescription: CharSequence, @NonNull intent: PendingIntent)

<init>(@NonNull other: RemoteActionCompat)

Constructs a RemoteActionCompat using data from other.

Public methods
static RemoteActionCompat
createFromBundle(@NonNull bundle: Bundle)

Converts the bundle created by toBundle() back to RemoteActionCompat.

static RemoteActionCompat
createFromRemoteAction(@NonNull remoteAction: RemoteAction)

Creates an RemoteActionCompat from a RemoteAction.

PendingIntent

Return the action intent.

CharSequence

Return a content description representing the action.

IconCompat

Return an icon representing the action.

CharSequence

Return an title representing the action.

Boolean

Return whether this action is enabled.

Unit
setEnabled(enabled: Boolean)

Sets whether this action is enabled.

Unit
setShouldShowIcon(shouldShowIcon: Boolean)

Sets whether the icon should be shown.

Boolean

Return whether the icon should be shown.

Bundle

Converts this into a Bundle that can be converted back to a RemoteActionCompat by calling createFromBundle(Bundle).

RemoteAction

Convert this compat object to RemoteAction object.

Public constructors

<init>

RemoteActionCompat(@NonNull icon: IconCompat, @NonNull title: CharSequence, @NonNull contentDescription: CharSequence, @NonNull intent: PendingIntent)

<init>

RemoteActionCompat(@NonNull other: RemoteActionCompat)

Constructs a RemoteActionCompat using data from other.

Public methods

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): RemoteActionCompat

Converts the bundle created by toBundle() back to RemoteActionCompat.

createFromRemoteAction

@NonNull static fun createFromRemoteAction(@NonNull remoteAction: RemoteAction): RemoteActionCompat

Creates an RemoteActionCompat from a RemoteAction.

getActionIntent

@NonNull fun getActionIntent(): PendingIntent

Return the action intent.

getContentDescription

@NonNull fun getContentDescription(): CharSequence

Return a content description representing the action.

getIcon

@NonNull fun getIcon(): IconCompat

Return an icon representing the action.

getTitle

@NonNull fun getTitle(): CharSequence

Return an title representing the action.

isEnabled

fun isEnabled(): Boolean

Return whether this action is enabled.

setEnabled

fun setEnabled(enabled: Boolean): Unit

Sets whether this action is enabled.

setShouldShowIcon

fun setShouldShowIcon(shouldShowIcon: Boolean): Unit

Sets whether the icon should be shown.

shouldShowIcon

fun shouldShowIcon(): Boolean

Return whether the icon should be shown.

toBundle

@NonNull fun toBundle(): Bundle

Converts this into a Bundle that can be converted back to a RemoteActionCompat by calling createFromBundle(Bundle).

toRemoteAction

@NonNull fun toRemoteAction(): RemoteAction

Convert this compat object to RemoteAction object.

Return
RemoteAction: RemoteAction object