RemoteActionCompat

Added in 1.1.0

class RemoteActionCompat : VersionedParcelable


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

Constructs a RemoteActionCompat using data from other.

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

Public functions

java-static RemoteActionCompat
@RequiresApi(value = 26)
createFromRemoteAction(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
@RequiresApi(value = 26)
toRemoteAction()

Convert this compat object to RemoteAction object.

Public constructors

RemoteActionCompat

Added in 1.1.0
RemoteActionCompat(other: RemoteActionCompat)

Constructs a RemoteActionCompat using data from other.

RemoteActionCompat

Added in 1.1.0
RemoteActionCompat(
    icon: IconCompat,
    title: CharSequence,
    contentDescription: CharSequence,
    intent: PendingIntent
)

Public functions

createFromRemoteAction

Added in 1.1.0
@RequiresApi(value = 26)
java-static fun createFromRemoteAction(remoteAction: RemoteAction): RemoteActionCompat

Creates an RemoteActionCompat from a RemoteAction.

getActionIntent

Added in 1.1.0
fun getActionIntent(): PendingIntent

Return the action intent.

getContentDescription

Added in 1.1.0
fun getContentDescription(): CharSequence

Return a content description representing the action.

getIcon

Added in 1.1.0
fun getIcon(): IconCompat

Return an icon representing the action.

getTitle

Added in 1.1.0
fun getTitle(): CharSequence

Return an title representing the action.

isEnabled

Added in 1.1.0
fun isEnabled(): Boolean

Return whether this action is enabled.

setEnabled

Added in 1.1.0
fun setEnabled(enabled: Boolean): Unit

Sets whether this action is enabled.

setShouldShowIcon

Added in 1.1.0
fun setShouldShowIcon(shouldShowIcon: Boolean): Unit

Sets whether the icon should be shown.

shouldShowIcon

Added in 1.1.0
fun shouldShowIcon(): Boolean

Return whether the icon should be shown.

toRemoteAction

Added in 1.1.0
@RequiresApi(value = 26)
fun toRemoteAction(): RemoteAction

Convert this compat object to RemoteAction object.

Returns
RemoteAction

RemoteAction object