MediaBrowserServiceCompat.Result

public static class MediaBrowserServiceCompat.Result
extends Object

java.lang.Object
   ↳ androidx.media.MediaBrowserServiceCompat.Result<T>


Completion handler for asynchronous callback methods in MediaBrowserServiceCompat.

Each of the methods that takes one of these to send the result must call either sendResult(T) or sendError(Bundle) to respond to the caller with the given results or errors. If those functions return without calling sendResult(T) or sendError(Bundle), they must instead call detach() before returning, and then may call sendResult(T) or sendError(Bundle) when they are done. If sendResult(T), sendError(Bundle), or detach() is called twice, an exception will be thrown.

Those functions might also want to call sendProgressUpdate(Bundle) to send interim updates to the caller. If it is called after calling sendResult(T) or sendError(Bundle), an exception will be thrown.

Summary

Public methods

void detach()

Detach this message from the current thread and allow the sendResult(T) call to happen later.

void sendError(Bundle extras)

Notify the caller of a failure.

void sendProgressUpdate(Bundle extras)

Send an interim update to the caller.

void sendResult(T result)

Send the result back to the caller.

Inherited methods