CallbackHandlerRegistry
public
class
CallbackHandlerRegistry
extends Object
java.lang.Object | |
↳ | androidx.remotecallback.CallbackHandlerRegistry |
The holder for callbacks that are tagged with RemoteCallable
.
Note: This should only be referenced by generated code, there is no reason to reference this
otherwise.
Summary
Nested classes | |
---|---|
interface |
CallbackHandlerRegistry.CallbackHandler<T extends CallbackReceiver>
The interface used to trigger a callback when the pending intent is fired. |
Public constructors | |
---|---|
CallbackHandlerRegistry()
|
Public methods | |
---|---|
<T extends CallbackReceiver>
void
|
invokeCallback(Context context, T receiver, Intent intent)
Trigger a call to a callback using arguments that were generated with
|
<T extends CallbackReceiver>
void
|
invokeCallback(Context context, T receiver, Bundle bundle)
Trigger a call to a callback using arguments that were generated with
|
static
<T extends CallbackReceiver>
void
|
registerCallbackHandler(Class<T> cls, String method, CallbackHandler<T> handler)
Registers a callback handler to be executed when a given PendingIntent is fired
for a |
static
RemoteCallback
|
stubToRemoteCallback(CallbackReceiver receiver, Class<? extends CallbackReceiver> cls, Bundle args, String method)
Turns a callback receiver stub into a remote callback. |
Inherited methods | |
---|---|
Public constructors
CallbackHandlerRegistry
public CallbackHandlerRegistry ()
Public methods
invokeCallback
public void invokeCallback (Context context, T receiver, Intent intent)
Trigger a call to a callback using arguments that were generated with
RemoteCallback.getArgumentBundle()
.
Parameters | |
---|---|
context |
Context |
receiver |
T |
intent |
Intent |
invokeCallback
public void invokeCallback (Context context, T receiver, Bundle bundle)
Trigger a call to a callback using arguments that were generated with
RemoteCallback.getArgumentBundle()
.
Parameters | |
---|---|
context |
Context |
receiver |
T |
bundle |
Bundle |
registerCallbackHandler
public static void registerCallbackHandler (Class<T> cls, String method, CallbackHandler<T> handler)
Registers a callback handler to be executed when a given PendingIntent is fired
for a RemoteCallback
.
Note: This should only be called by generated code, there is no reason to reference this
otherwise.
Parameters | |
---|---|
cls |
Class |
method |
String |
handler |
CallbackHandler |
stubToRemoteCallback
public static RemoteCallback stubToRemoteCallback (CallbackReceiver receiver, Class<? extends CallbackReceiver> cls, Bundle args, String method)
Turns a callback receiver stub into a remote callback. Note: This should only be called by generated code, there is no reason to reference this otherwise.
Parameters | |
---|---|
receiver |
CallbackReceiver |
cls |
Class |
args |
Bundle |
method |
String |
Returns | |
---|---|
RemoteCallback |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-30 UTC.