added in version 24.1.0
belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1

MediaBrowserServiceCompat.Result

public static class MediaBrowserServiceCompat.Result
extends Object

java.lang.Object
   ↳ android.support.v4.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

From class java.lang.Object

Public methods

detach

added in version 24.1.0
void detach ()

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

sendError

added in version 25.4.0
void sendError (Bundle extras)

Notify the caller of a failure. This is supported only when it is used in onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result).

Parameters
extras Bundle: A bundle that contains extra data.

sendProgressUpdate

added in version 25.4.0
void sendProgressUpdate (Bundle extras)

Send an interim update to the caller. This method is supported only when it is used in onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result).

Parameters
extras Bundle: A bundle that contains extra data.

sendResult

added in version 24.1.0
void sendResult (T result)

Send the result back to the caller.

Parameters
result T