# RemoteCallback

Artifact: [androidx.remotecallback:remotecallback](https://developer.android.com/jetpack/androidx/releases/remotecallback) [View Source](https://cs.android.com/search?q=file:androidx/remotecallback/RemoteCallback.java+class:androidx.remotecallback.RemoteCallback) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

*** ** * ** ***


```
public class RemoteCallback
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Slice framework has been deprecated, it will not receive any updates moving forward. If you are looking for a framework that handles communication across apps, consider using `https://developer.android.com/reference/android/app/appsearch/AppSearchManager.html`.

An instance of a callback to a specific class/method with a specific set of arguments. Can only be obtained from a `https://developer.android.com/reference/androidx/remotecallback/CallbackReceiver`.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/remotecallback/RemoteCallback` | `https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#LOCAL()` **This field is deprecated.** Deprecated in Java |
| `static final int` | `https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#TYPE_PROVIDER() = 1` **This field is deprecated.** Deprecated in Java |
| `static final int` | `https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#TYPE_RECEIVER() = 0` **This field is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `static T` | `<T extends https://developer.android.com/reference/androidx/remotecallback/CallbackReceiver> [create](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#create(java.lang.Class<T>,android.content.Context))(https://developer.android.com/reference/java/lang/Class.html<T> cls, https://developer.android.com/reference/android/content/Context.html context)` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/android/os/Bundle.html` | `[getArgumentBundle](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getArgumentBundle())()` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/java/lang/String.html` | `[getMethodName](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getMethodName())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `[getReceiverClass](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getReceiverClass())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[getType](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getType())()` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/android/app/PendingIntent.html` | `[toPendingIntent](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#toPendingIntent())()` **This method is deprecated.** Deprecated in Java |

## Constants

### LOCAL

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public static final RemoteCallback LOCAL
```

> [!CAUTION]
> **This field is deprecated.**   
> Deprecated in Java

Constant value that actual implementations of `https://developer.android.com/reference/androidx/remotecallback/RemoteCallable` should return.

### TYPE_PROVIDER

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public static final int TYPE_PROVIDER = 1
```

> [!CAUTION]
> **This field is deprecated.**   
> Deprecated in Java

Constant indicating this callback will be triggered on a `https://developer.android.com/reference/android/content/ContentProvider.html`.

### TYPE_RECEIVER

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public static final int TYPE_RECEIVER = 0
```

> [!CAUTION]
> **This field is deprecated.**   
> Deprecated in Java

Constant indicating this callback will be triggered on a `https://developer.android.com/reference/android/content/BroadcastReceiver.html`.

## Public methods

### create

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public static T <T extends CallbackReceiver> [create](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#create(java.lang.Class<T>,android.content.Context))(Class<T> cls, Context context)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Static version of `https://developer.android.com/reference/androidx/remotecallback/CallbackReceiver#createRemoteCallback(android.content.Context)`.

### getArgumentBundle

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public Bundle [getArgumentBundle](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getArgumentBundle())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the bundle of arguments that will be used to trigger the method.

### getMethodName

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public String [getMethodName](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getMethodName())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the name of the method this callback will call.

### getReceiverClass

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public @NonNull String [getReceiverClass](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getReceiverClass())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the class the callback will be called on.

### getType

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public int [getType](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#getType())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Get the type of the receiver of this callback.

### toPendingIntent

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/remotecallback#1.0.0-alpha03)

```
public PendingIntent [toPendingIntent](https://developer.android.com/reference/androidx/remotecallback/RemoteCallback#toPendingIntent())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Create a `https://developer.android.com/reference/android/app/PendingIntent.html` that will trigger this callback.