RemoteActionCompat

class RemoteActionCompat : VersionedParcelable
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
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.

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

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.

toRemoteAction

@NonNull fun toRemoteAction(): RemoteAction

Convert this compat object to RemoteAction object.

Return
RemoteAction: RemoteAction object