# RemoteActionCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/RemoteActionCompat.java+class:androidx.core.app.RemoteActionCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public final class RemoteActionCompat implements VersionedParcelable
```

<br />

*** ** * ** ***

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 `https://developer.android.com/reference/android/app/RemoteAction.html`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#RemoteActionCompat(androidx.core.app.RemoteActionCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/RemoteActionCompat other)` Constructs a `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat` using data from `other`. |
| `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#RemoteActionCompat(androidx.core.graphics.drawable.IconCompat,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/drawable/IconCompat icon, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html title, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html contentDescription, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html intent )` |

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/RemoteActionCompat` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#createFromRemoteAction(android.app.RemoteAction)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/RemoteAction.html remoteAction)` Creates an RemoteActionCompat from a RemoteAction. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/PendingIntent.html` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#getActionIntent()()` Return the action intent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#getContentDescription()()` Return a content description representing the action. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/drawable/IconCompat` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#getIcon()()` Return an icon representing the action. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#getTitle()()` Return an title representing the action. |
| `boolean` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#isEnabled()()` Return whether this action is enabled. |
| `void` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#setEnabled(boolean)(boolean enabled)` Sets whether this action is enabled. |
| `void` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#setShouldShowIcon(boolean)(boolean shouldShowIcon)` Sets whether the icon should be shown. |
| `boolean` | `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#shouldShowIcon()()` Return whether the icon should be shown. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/RemoteAction.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/app/RemoteActionCompat#toRemoteAction()()` Convert this compat object to `https://developer.android.com/reference/android/app/RemoteAction.html` object. |

## Public constructors

### RemoteActionCompat

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public RemoteActionCompat(@NonNull RemoteActionCompat other)
```

Constructs a `https://developer.android.com/reference/androidx/core/app/RemoteActionCompat` using data from `other`.

### RemoteActionCompat

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#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](https://developer.android.com/jetpack/androidx/releases/core#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](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @NonNull PendingIntent getActionIntent()
```

Return the action intent.

### getContentDescription

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @NonNull CharSequence getContentDescription()
```

Return a content description representing the action.

### getIcon

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @NonNull IconCompat getIcon()
```

Return an icon representing the action.

### getTitle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @NonNull CharSequence getTitle()
```

Return an title representing the action.

### isEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public boolean isEnabled()
```

Return whether this action is enabled.

### setEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void setEnabled(boolean enabled)
```

Sets whether this action is enabled.

### setShouldShowIcon

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void setShouldShowIcon(boolean shouldShowIcon)
```

Sets whether the icon should be shown.

### shouldShowIcon

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public boolean shouldShowIcon()
```

Return whether the icon should be shown.

### toRemoteAction

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

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

Convert this compat object to `https://developer.android.com/reference/android/app/RemoteAction.html` object.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/RemoteAction.html` | `https://developer.android.com/reference/android/app/RemoteAction.html` object |