# ContentProviderWithCallbacks

Artifact: [androidx.remotecallback:remotecallback](https://developer.android.com/jetpack/androidx/releases/remotecallback) [View Source](https://cs.android.com/search?q=file:androidx/remotecallback/ContentProviderWithCallbacks.java+class:androidx.remotecallback.ContentProviderWithCallbacks) 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)

*** ** * ** ***


```
abstract class ContentProviderWithCallbacks<T : ContentProviderWithCallbacks?> : ContentProvider, CallbackReceiver<T!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.content.ContentProvider](https://developer.android.com/reference/android/content/ContentProvider.html) ||
|   | ↳ | [androidx.remotecallback.ContentProviderWithCallbacks](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks) |

*** ** * ** ***

> [!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`.

Version of ContentProvider that can be used as a `https://developer.android.com/reference/kotlin/androidx/remotecallback/CallbackReceiver`. Be sure to call the super of `https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#call(java.lang.String,java.lang.String,android.os.Bundle)` when unhandled to ensure callbacks are triggered.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks?>` | Should be specified as the root class (e.g. class X extends ContentProviderWithCallbacks\\) |

## Summary

| ### Public constructors |
|---|
| `[ContentProviderWithCallbacks](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#ContentProviderWithCallbacks())()` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[attachInfo](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#attachInfo(android.content.Context,android.content.pm.ProviderInfo))(context: https://developer.android.com/reference/android/content/Context.html!, info: https://developer.android.com/reference/android/content/pm/ProviderInfo.html!)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/android/os/Bundle.html?` | `[call](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#call(java.lang.String,java.lang.String,android.os.Bundle))(method: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, arg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, extras: https://developer.android.com/reference/android/os/Bundle.html?)` **This function is deprecated.** Deprecated in Java |
| `T` | `[createRemoteCallback](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#createRemoteCallback(android.content.Context))(context: https://developer.android.com/reference/android/content/Context.html)` **This function is deprecated.** Deprecated in Java |

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40`

**This property is deprecated.** Deprecated in Java
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20`

**This property is deprecated.** Deprecated in Java

### Inherited functions

From [android.content.ContentProvider](https://developer.android.com/reference/android/content/ContentProvider.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/ContentProviderResult.html!>!` `[applyBatch](https://developer.android.com/reference/android/content/ContentProvider.html#applyBatch(java.lang.String, java.util.ArrayList&lt;android.content.ContentProviderOperation&gt;))(
authority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
operations: https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/android/content/ContentProviderOperation.html!>!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[bulkInsert](https://developer.android.com/reference/android/content/ContentProvider.html#bulkInsert(android.net.Uri, android.content.ContentValues[]))(uri: https://developer.android.com/reference/android/net/Uri.html!, values: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/ContentValues.html!>!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/net/Uri.html!` `[canonicalize](https://developer.android.com/reference/android/content/ContentProvider.html#canonicalize(android.net.Uri))(url: https://developer.android.com/reference/android/net/Uri.html!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/content/ContentProvider.CallingIdentity.html!` `[clearCallingIdentity](https://developer.android.com/reference/android/content/ContentProvider.html#clearCallingIdentity())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[delete](https://developer.android.com/reference/android/content/ContentProvider.html#delete(android.net.Uri, android.os.Bundle))(uri: https://developer.android.com/reference/android/net/Uri.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[dump](https://developer.android.com/reference/android/content/ContentProvider.html#dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))(fd: https://developer.android.com/reference/java/io/FileDescriptor.html!, writer: https://developer.android.com/reference/java/io/PrintWriter.html!, args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/content/AttributionSource.html!` `[getCallingAttributionSource](https://developer.android.com/reference/android/content/ContentProvider.html#getCallingAttributionSource())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getCallingAttributionTag](https://developer.android.com/reference/android/content/ContentProvider.html#getCallingAttributionTag())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getCallingPackage](https://developer.android.com/reference/android/content/ContentProvider.html#getCallingPackage())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getCallingPackageUnchecked](https://developer.android.com/reference/android/content/ContentProvider.html#getCallingPackageUnchecked())()`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/content/Context.html!` `[getContext](https://developer.android.com/reference/android/content/ContentProvider.html#getContext())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/pm/PathPermission.html!>!` `[getPathPermissions](https://developer.android.com/reference/android/content/ContentProvider.html#getPathPermissions())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getReadPermission](https://developer.android.com/reference/android/content/ContentProvider.html#getReadPermission())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` `[getStreamTypes](https://developer.android.com/reference/android/content/ContentProvider.html#getStreamTypes(android.net.Uri, java.lang.String))(uri: https://developer.android.com/reference/android/net/Uri.html!, mimeTypeFilter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.** Deprecated in Java
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getType](https://developer.android.com/reference/android/content/ContentProvider.html#getType(android.net.Uri))(p: https://developer.android.com/reference/android/net/Uri.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getTypeAnonymous](https://developer.android.com/reference/android/content/ContentProvider.html#getTypeAnonymous(android.net.Uri))(uri: https://developer.android.com/reference/android/net/Uri.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getWritePermission](https://developer.android.com/reference/android/content/ContentProvider.html#getWritePermission())()`

**This function is deprecated.** Deprecated in Java
`abstract https://developer.android.com/reference/android/net/Uri.html!` `[insert](https://developer.android.com/reference/android/content/ContentProvider.html#insert(android.net.Uri, android.content.ContentValues))(p: https://developer.android.com/reference/android/net/Uri.html!, p1: https://developer.android.com/reference/android/content/ContentValues.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isTemporary](https://developer.android.com/reference/android/content/ContentProvider.html#isTemporary())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onCallingPackageChanged](https://developer.android.com/reference/android/content/ContentProvider.html#onCallingPackageChanged())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onConfigurationChanged](https://developer.android.com/reference/android/content/ContentProvider.html#onConfigurationChanged(android.content.res.Configuration))(newConfig: https://developer.android.com/reference/android/content/res/Configuration.html!)`

**This function is deprecated.** Deprecated in Java
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[onCreate](https://developer.android.com/reference/android/content/ContentProvider.html#onCreate())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onLowMemory](https://developer.android.com/reference/android/content/ContentProvider.html#onLowMemory())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onTrimMemory](https://developer.android.com/reference/android/content/ContentProvider.html#onTrimMemory(int))(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html!` `[openAssetFile](https://developer.android.com/reference/android/content/ContentProvider.html#openAssetFile(android.net.Uri, java.lang.String))(uri: https://developer.android.com/reference/android/net/Uri.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` `[openFile](https://developer.android.com/reference/android/content/ContentProvider.html#openFile(android.net.Uri, java.lang.String))(uri: https://developer.android.com/reference/android/net/Uri.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` `[openFileHelper](https://developer.android.com/reference/android/content/ContentProvider.html#openFileHelper(android.net.Uri, java.lang.String))(uri: https://developer.android.com/reference/android/net/Uri.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` `<T> [openPipeHelper](https://developer.android.com/reference/android/content/ContentProvider.html#openPipeHelper(android.net.Uri, java.lang.String, android.os.Bundle, T, android.content.ContentProvider.PipeDataWriter&lt;T&gt;))(
uri: https://developer.android.com/reference/android/net/Uri.html!,
mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
opts: https://developer.android.com/reference/android/os/Bundle.html!,
args: T!,
func: https://developer.android.com/reference/android/content/ContentProvider.PipeDataWriter.html<T!>!
)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html!` `[openTypedAssetFile](https://developer.android.com/reference/android/content/ContentProvider.html#openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle))(uri: https://developer.android.com/reference/android/net/Uri.html!, mimeTypeFilter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, opts: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/database/Cursor.html!` `[query](https://developer.android.com/reference/android/content/ContentProvider.html#query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal))(
uri: https://developer.android.com/reference/android/net/Uri.html!,
projection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!,
queryArgs: https://developer.android.com/reference/android/os/Bundle.html!,
cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[refresh](https://developer.android.com/reference/android/content/ContentProvider.html#refresh(android.net.Uri, android.os.Bundle, android.os.CancellationSignal))(uri: https://developer.android.com/reference/android/net/Uri.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!, cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html!)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/content/Context.html!` `[requireContext](https://developer.android.com/reference/android/content/ContentProvider.html#requireContext())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[restoreCallingIdentity](https://developer.android.com/reference/android/content/ContentProvider.html#restoreCallingIdentity(android.content.ContentProvider.CallingIdentity))(identity: https://developer.android.com/reference/android/content/ContentProvider.CallingIdentity.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setPathPermissions](https://developer.android.com/reference/android/content/ContentProvider.html#setPathPermissions(android.content.pm.PathPermission[]))(permissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/pm/PathPermission.html!>!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setReadPermission](https://developer.android.com/reference/android/content/ContentProvider.html#setReadPermission(java.lang.String))(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setWritePermission](https://developer.android.com/reference/android/content/ContentProvider.html#setWritePermission(java.lang.String))(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[shutdown](https://developer.android.com/reference/android/content/ContentProvider.html#shutdown())()`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/android/net/Uri.html!` `[uncanonicalize](https://developer.android.com/reference/android/content/ContentProvider.html#uncanonicalize(android.net.Uri))(url: https://developer.android.com/reference/android/net/Uri.html!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[update](https://developer.android.com/reference/android/content/ContentProvider.html#update(android.net.Uri, android.content.ContentValues, android.os.Bundle))(uri: https://developer.android.com/reference/android/net/Uri.html!, values: https://developer.android.com/reference/android/content/ContentValues.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.** Deprecated in Java

## Public constructors

### ContentProviderWithCallbacks

Added in 1.0.0-alpha03 Deprecated in 1.0.0-alpha03

```
[ContentProviderWithCallbacks](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#ContentProviderWithCallbacks())()
```

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

## Public functions

### attachInfo

```
fun [attachInfo](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#attachInfo(android.content.Context,android.content.pm.ProviderInfo))(context: Context!, info: ProviderInfo!): Unit
```

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

### call

```
fun [call](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#call(java.lang.String,java.lang.String,android.os.Bundle))(method: String, arg: String?, extras: Bundle?): Bundle?
```

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

### createRemoteCallback

```
fun [createRemoteCallback](https://developer.android.com/reference/kotlin/androidx/remotecallback/ContentProviderWithCallbacks#createRemoteCallback(android.content.Context))(context: Context): T
```

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

Creates a `https://developer.android.com/reference/kotlin/androidx/remotecallback/RemoteCallback` that will call the method with method specified with the arguments specified when triggered. Only methods tagged with `https://developer.android.com/reference/kotlin/androidx/remotecallback/RemoteCallable` can be used here. This method returns a stub implementation of the class calling it to record the arguments/method being used. This should only be used in a chain of 2 calls, starting with createRemoteCallback(), then followed up with a call to any method tagged with `https://developer.android.com/reference/kotlin/androidx/remotecallback/RemoteCallable`.

```kotlin
    createRemoteCallback().callMyMethod("My arguments", 43, 2.4)
             .toPendingIntent(context);
```

```kotlin
    \@RemoteCallable
    public RemoteCallback callMyMethod(String argStr, int argInt, double argDouble) {
        ...
        return RemoteCallback.LOCAL;
    }
```