ContentProviderWithCallbacks


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


Version of ContentProvider that can be used as a CallbackReceiver. Be sure to call the super of call when unhandled to ensure callbacks are triggered.

Parameters
<T : ContentProviderWithCallbacks?>

Should be specified as the root class (e.g. class X extends ContentProviderWithCallbacks\)

Summary

Public constructors

Public functions

Unit
attachInfo(context: Context!, info: ProviderInfo!)
Bundle!
call(method: String!, arg: String!, extras: Bundle!)
T!

Creates a RemoteCallback that will call the method with method specified with the arguments specified when triggered.

Inherited functions

From android.content.ContentProvider
Array<ContentProviderResult!>!
applyBatch(
    authority: String!,
    operations: ArrayList<ContentProviderOperation!>!
)
Int
bulkInsert(uri: Uri!, values: Array<ContentValues!>!)
Bundle!
call(authority: String!, method: String!, arg: String!, extras: Bundle!)
Uri!
ContentProvider.CallingIdentity!
abstract Int
delete(p: Uri!, p1: String!, p2: Array<String!>!)
Unit
dump(fd: FileDescriptor!, writer: PrintWriter!, args: Array<String!>!)
AttributionSource!
String!
String!
String!
Context!
Array<PathPermission!>!
String!
Array<String!>!
getStreamTypes(uri: Uri!, mimeTypeFilter: String!)
abstract String!
getType(p: Uri!)
String!
String!
abstract Uri!
insert(p: Uri!, p1: ContentValues!)
Boolean
Unit
Unit
abstract Boolean
Unit
Unit
onTrimMemory(level: Int)
AssetFileDescriptor!
openAssetFile(uri: Uri!, mode: String!)
ParcelFileDescriptor!
openFile(uri: Uri!, mode: String!)
ParcelFileDescriptor!
openFileHelper(uri: Uri!, mode: String!)
ParcelFileDescriptor!
<T> openPipeHelper(
    uri: Uri!,
    mimeType: String!,
    opts: Bundle!,
    args: T!,
    func: ContentProvider.PipeDataWriter<T!>!
)
AssetFileDescriptor!
openTypedAssetFile(uri: Uri!, mimeTypeFilter: String!, opts: Bundle!)
abstract Cursor!
query(p: Uri!, p1: Array<String!>!, p2: String!, p3: Array<String!>!, p4: String!)
Boolean
refresh(uri: Uri!, extras: Bundle!, cancellationSignal: CancellationSignal!)
Context!
Unit
Unit
Unit
setReadPermission(permission: String!)
Unit
setWritePermission(permission: String!)
Unit
Uri!
abstract Int
update(p: Uri!, p1: ContentValues!, p2: String!, p3: Array<String!>!)

Public constructors

ContentProviderWithCallbacks

Added in 1.0.0-alpha02
ContentProviderWithCallbacks()

Public functions

attachInfo

fun attachInfo(context: Context!, info: ProviderInfo!): Unit

call

fun call(method: String!, arg: String!, extras: Bundle!): Bundle!

createRemoteCallback

Added in 1.0.0-alpha02
fun createRemoteCallback(context: Context!): T!

Creates a RemoteCallback that will call the method with method specified with the arguments specified when triggered. Only methods tagged with 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 RemoteCallable.

    createRemoteCallback().callMyMethod("My arguments", 43, 2.4)
             .toPendingIntent(context);
    \@RemoteCallable
    public RemoteCallback callMyMethod(String argStr, int argInt, double argDouble) {
        ...
        return RemoteCallback.LOCAL;
    }