Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#inhmethods)

# MediaBrowserService.Result

*** ** * ** ***

` public class MediaBrowserService.Result `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.service.media.MediaBrowserService.Result\<T\> |

<br />

*** ** * ** ***

Completion handler for asynchronous callback methods in `https://developer.android.com/reference/android/service/media/MediaBrowserService`.

Each of the methods that takes one of these to send the result must call `https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#sendResult(T)` to respond to the caller with the given results. If those functions return without calling `https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#sendResult(T)`, they must instead call `https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#detach()` before returning, and then may call `https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#sendResult(T)` when they are done. If more than one of those methods is called, an exception will be thrown.
**See also:**

- `https://developer.android.com/reference/android/service/media/MediaBrowserService#onLoadChildren(java.lang.String,%20android.service.media.MediaBrowserService.Result<java.util.List<android.media.browse.MediaBrowser.MediaItem>>)`
- `https://developer.android.com/reference/android/service/media/MediaBrowserService#onLoadItem(java.lang.String,%20android.service.media.MediaBrowserService.Result<android.media.browse.MediaBrowser.MediaItem>)`

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#detach()() ` Detach this message from the current thread and allow the `https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#sendResult(T)` call to happen later. |
| ` void` | ` https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#sendResult(T)(T result) ` Send the result back to the caller. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### detach

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void detach ()
```

Detach this message from the current thread and allow the `https://developer.android.com/reference/android/service/media/MediaBrowserService.Result#sendResult(T)` call to happen later.

<br />

### sendResult

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendResult (T result)
```

Send the result back to the caller.

<br />

| Parameters ||
|---|---|
| `result` | `T` <br /> |