Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/com/google/wear/services/media/MediaManager#constants) \| [Methods](https://developer.android.com/reference/com/google/wear/services/media/MediaManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/services/media/MediaManager#inhmethods)

# MediaManager


`
public

final

class
MediaManager
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.services.media.MediaManager |

<br />

*** ** * ** ***

Provides a public interface for managing media auto-launch settings.

An instance of this class can be obtained directly via the Wear SDK by invoking `https://developer.android.com/reference/com/google/wear/Sdk#getWearManager(android.content.Context,%20java.lang.Class<T>)` API.

## Summary

| ### Constants ||
|---|---|
| `String` | `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#ACTION_REMOTE_MEDIA_ACTIVITY` An intent action declared by media applications that can handle Remote media sessions. |
| `int` | `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#MEDIA_AUTO_LAUNCH_STATE_DISABLED` Indicates that the auto-launch setting is disabled for the calling application. |
| `int` | `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#MEDIA_AUTO_LAUNCH_STATE_ENABLED` Indicates that the auto-launch setting is enabled for the calling application. |
| `int` | `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#MEDIA_AUTO_LAUNCH_STATE_UNKNOWN` Indicates that the auto-launch setting is not supported on the device or the setting state is unknown. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/com/google/wear/services/media/MediaManager#getMediaAutoLaunchState()() ` Checks if media auto-launch is enabled for the calling application. |
| ` boolean` | ` https://developer.android.com/reference/com/google/wear/services/media/MediaManager#showMediaAutoLaunchSettings()() ` Launches the system's media auto-launch settings screen for this application. |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Constants

### ACTION_REMOTE_MEDIA_ACTIVITY

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

```
public static final String ACTION_REMOTE_MEDIA_ACTIVITY
```

An intent action declared by media applications that can handle Remote media sessions.
The activity handling this intent would be associated with the media session fetched from the
phone to the watch.

<br />

Constant Value:

"com.google.wear.services.media.action.REMOTE_MEDIA_ACTIVITY"


### MEDIA_AUTO_LAUNCH_STATE_DISABLED

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

```
public static final int MEDIA_AUTO_LAUNCH_STATE_DISABLED
```

Indicates that the auto-launch setting is disabled for the calling application.

<br />

Constant Value:

1
(0x00000001)


### MEDIA_AUTO_LAUNCH_STATE_ENABLED

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

```
public static final int MEDIA_AUTO_LAUNCH_STATE_ENABLED
```

Indicates that the auto-launch setting is enabled for the calling application.

<br />

Constant Value:

2
(0x00000002)


### MEDIA_AUTO_LAUNCH_STATE_UNKNOWN

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

```
public static final int MEDIA_AUTO_LAUNCH_STATE_UNKNOWN
```

Indicates that the auto-launch setting is not supported on the device or the setting
state is unknown. It is recommended to disable auto-launch related features when this value
is returned.

<br />

Constant Value:

0
(0x00000000)


## Public methods

### getMediaAutoLaunchState

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

```
public int getMediaAutoLaunchState ()
```

Checks if media auto-launch is enabled for the calling application.

This can be used by media apps to check whether their application will be auto-launched
when a media session starts on the connected phone. When enabled by the user, the activity
associated with the remote session will be launched. A media application may associate an
activity with the session by applying `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#ACTION_REMOTE_MEDIA_ACTIVITY` intent filter to
their activity.

<br />

| Returns ||
|---|---|
| `int` | The auto-launch state of the calling application. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#MEDIA_AUTO_LAUNCH_STATE_UNKNOWN` - `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#MEDIA_AUTO_LAUNCH_STATE_ENABLED` - `https://developer.android.com/reference/com/google/wear/services/media/MediaManager#MEDIA_AUTO_LAUNCH_STATE_DISABLED` |

### showMediaAutoLaunchSettings

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

```
public boolean showMediaAutoLaunchSettings ()
```

Launches the system's media auto-launch settings screen for this application.

This should be used by applications to allow users to toggle the media auto-launch
preferences for the application.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the settings screen was launched, `false` otherwise. <br /> |