# RemoteActionCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/app/RemoteActionCompat "View this page in Java")

<br />

```
class RemoteActionCompat : 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[RemoteAction](https://developer.android.com/reference/android/app/RemoteAction.html).

## Summary

|                                                                                                                                                                                                                                                                                                                                               ### Public constructors                                                                                                                                                                                                                                                                                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RemoteActionCompat](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#RemoteActionCompat(androidx.core.app.RemoteActionCompat))`(other: `[RemoteActionCompat](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat)`)` Constructs a[RemoteActionCompat](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat)using data from`other`.                                                                                                                                                                                                                                                                               |
| [RemoteActionCompat](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#RemoteActionCompat(androidx.core.graphics.drawable.IconCompat,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent))`(` ` icon: `[IconCompat](https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/IconCompat)`,` ` title: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` contentDescription: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` intent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) `)` |

|                                                  ### Public functions                                                   |
|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[RemoteActionCompat](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat) | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 26)` [createFromRemoteAction](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#createFromRemoteAction(android.app.RemoteAction))`(remoteAction: `[RemoteAction](https://developer.android.com/reference/android/app/RemoteAction.html)`)` Creates an RemoteActionCompat from a RemoteAction. |
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)                                 | [getActionIntent](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#getActionIntent())`()` Return the action intent.                                                                                                                                                                                                                                                                                    |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)                          | [getContentDescription](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#getContentDescription())`()` Return a content description representing the action.                                                                                                                                                                                                                                            |
| [IconCompat](https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/IconCompat)                 | [getIcon](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#getIcon())`()` Return an icon representing the action.                                                                                                                                                                                                                                                                                      |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)                          | [getTitle](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#getTitle())`()` Return an title representing the action.                                                                                                                                                                                                                                                                                   |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                     | [isEnabled](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#isEnabled())`()` Return whether this action is enabled.                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                           | [setEnabled](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#setEnabled(boolean))`(enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether this action is enabled.                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                           | [setShouldShowIcon](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#setShouldShowIcon(boolean))`(shouldShowIcon: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether the icon should be shown.                                                                                                                                                       |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                     | [shouldShowIcon](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#shouldShowIcon())`()` Return whether the icon should be shown.                                                                                                                                                                                                                                                                       |
| [RemoteAction](https://developer.android.com/reference/android/app/RemoteAction.html)                                   | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 26)` [toRemoteAction](https://developer.android.com/reference/kotlin/androidx/core/app/RemoteActionCompat#toRemoteAction())`()` Convert this compat object to[RemoteAction](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)  

```
RemoteActionCompat(other: RemoteActionCompat)
```

Constructs a[RemoteActionCompat](https://developer.android.com/reference/kotlin/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)  

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

## Public functions

### createFromRemoteAction

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

```
fun getActionIntent(): PendingIntent
```

Return the action intent.  

### getContentDescription

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

```
fun getContentDescription(): CharSequence
```

Return a content description representing the action.  

### getIcon

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

```
fun getIcon(): IconCompat
```

Return an icon representing the action.  

### getTitle

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

```
fun getTitle(): CharSequence
```

Return an title representing the action.  

### isEnabled

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

```
fun isEnabled(): Boolean
```

Return whether this action is enabled.  

### setEnabled

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

```
fun setEnabled(enabled: Boolean): Unit
```

Sets whether this action is enabled.  

### setShouldShowIcon

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

```
fun setShouldShowIcon(shouldShowIcon: Boolean): Unit
```

Sets whether the icon should be shown.  

### shouldShowIcon

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

```
fun shouldShowIcon(): Boolean
```

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)
fun toRemoteAction(): RemoteAction
```

Convert this compat object to[RemoteAction](https://developer.android.com/reference/android/app/RemoteAction.html)object.  

|                                        Returns                                        |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| [RemoteAction](https://developer.android.com/reference/android/app/RemoteAction.html) | [RemoteAction](https://developer.android.com/reference/android/app/RemoteAction.html)object |