Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#constants) \| [Ctors](https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#pubctors) \| [Methods](https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#inhmethods)

# OnObbStateChangeListener

*** ** * ** ***

` public abstract class OnObbStateChangeListener `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.storage.OnObbStateChangeListener |

<br />

*** ** * ** ***

Used for receiving notifications from `https://developer.android.com/reference/android/os/storage/StorageManager` about OBB file states.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#ERROR_ALREADY_MOUNTED` The OBB has already been mounted. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#ERROR_COULD_NOT_MOUNT` The OBB could not be mounted by the system. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#ERROR_COULD_NOT_UNMOUNT` The OBB could not be unmounted. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#ERROR_INTERNAL` There was an internal system error encountered while trying to mount the OBB. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#ERROR_NOT_MOUNTED` A call was made to unmount the OBB when it was not mounted. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#ERROR_PERMISSION_DENIED` The current application does not have permission to use this OBB. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#MOUNTED` The OBB container is now mounted and ready for use. |
| `int` | `https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#UNMOUNTED` The OBB container is now unmounted and not usable. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#OnObbStateChangeListener()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener#onObbStateChange(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String path, int state) ` Called when an OBB has changed states. |

### 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*.

## Constants

### ERROR_ALREADY_MOUNTED

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

```
public static final int ERROR_ALREADY_MOUNTED
```

The OBB has already been mounted. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 24 (0x00000018)

### ERROR_COULD_NOT_MOUNT

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

```
public static final int ERROR_COULD_NOT_MOUNT
```

The OBB could not be mounted by the system. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 21 (0x00000015)

### ERROR_COULD_NOT_UNMOUNT

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

```
public static final int ERROR_COULD_NOT_UNMOUNT
```

The OBB could not be unmounted. This most likely indicates that a file is in use on the OBB. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 22 (0x00000016)

### ERROR_INTERNAL

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

```
public static final int ERROR_INTERNAL
```

There was an internal system error encountered while trying to mount the OBB. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 20 (0x00000014)

### ERROR_NOT_MOUNTED

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

```
public static final int ERROR_NOT_MOUNTED
```

A call was made to unmount the OBB when it was not mounted. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 23 (0x00000017)

### ERROR_PERMISSION_DENIED

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

```
public static final int ERROR_PERMISSION_DENIED
```

The current application does not have permission to use this OBB. This could be because the OBB indicates it's owned by a different package or some other error. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 25 (0x00000019)

### MOUNTED

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

```
public static final int MOUNTED
```

The OBB container is now mounted and ready for use. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 1 (0x00000001)

### UNMOUNTED

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

```
public static final int UNMOUNTED
```

The OBB container is now unmounted and not usable. Returned in status messages from calls made via `https://developer.android.com/reference/android/os/storage/StorageManager`

<br />

Constant Value: 2 (0x00000002)

## Public constructors

### OnObbStateChangeListener

```
public OnObbStateChangeListener ()
```

<br />

<br />

## Public methods

### onObbStateChange

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

```
public void onObbStateChange (String path, 
                int state)
```

Called when an OBB has changed states.

<br />

| Parameters ||
|---|---|
| `path` | `String`: path to the OBB file the state change has happened on <br /> |
| `state` | `int`: the current state of the OBB <br /> |