RemoteActionCompat

Added in 1.1.0

public final class RemoteActionCompat implements 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(
    @NonNull IconCompat icon,
    @NonNull CharSequence title,
    @NonNull CharSequence contentDescription,
    @NonNull PendingIntent intent
)

Public methods

static @NonNull RemoteActionCompat

Creates an RemoteActionCompat from a RemoteAction.

@NonNull PendingIntent

Return the action intent.

@NonNull CharSequence

Return a content description representing the action.

@NonNull IconCompat

Return an icon representing the action.

@NonNull CharSequence

Return an title representing the action.

boolean

Return whether this action is enabled.

void
setEnabled(boolean enabled)

Sets whether this action is enabled.

void
setShouldShowIcon(boolean shouldShowIcon)

Sets whether the icon should be shown.

boolean

Return whether the icon should be shown.

@NonNull RemoteAction
@RequiresApi(value = 26)
toRemoteAction()

Convert this compat object to RemoteAction object.

Public constructors

RemoteActionCompat

Added in 1.1.0
public RemoteActionCompat(@NonNull RemoteActionCompat other)

Constructs a RemoteActionCompat using data from other.

RemoteActionCompat

Added in 1.1.0
public RemoteActionCompat(
    @NonNull IconCompat icon,
    @NonNull CharSequence title,
    @NonNull CharSequence contentDescription,
    @NonNull PendingIntent intent
)

Public methods

createFromRemoteAction

Added in 1.1.0
@RequiresApi(value = 26)
public static @NonNull RemoteActionCompat createFromRemoteAction(@NonNull RemoteAction remoteAction)

Creates an RemoteActionCompat from a RemoteAction.

getActionIntent

Added in 1.1.0
public @NonNull PendingIntent getActionIntent()

Return the action intent.

getContentDescription

Added in 1.1.0
public @NonNull CharSequence getContentDescription()

Return a content description representing the action.

getIcon

Added in 1.1.0
public @NonNull IconCompat getIcon()

Return an icon representing the action.

getTitle

Added in 1.1.0
public @NonNull CharSequence getTitle()

Return an title representing the action.

isEnabled

Added in 1.1.0
public boolean isEnabled()

Return whether this action is enabled.

setEnabled

Added in 1.1.0
public void setEnabled(boolean enabled)

Sets whether this action is enabled.

setShouldShowIcon

Added in 1.1.0
public void setShouldShowIcon(boolean shouldShowIcon)

Sets whether the icon should be shown.

shouldShowIcon

Added in 1.1.0
public boolean shouldShowIcon()

Return whether the icon should be shown.

toRemoteAction

Added in 1.1.0
@RequiresApi(value = 26)
public @NonNull RemoteAction toRemoteAction()

Convert this compat object to RemoteAction object.