# PictureInPictureModeChangedInfo

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/PictureInPictureModeChangedInfo.kt+class:androidx.core.app.PictureInPictureModeChangedInfo) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

*** ** * ** ***

<br />

```
public final class PictureInPictureModeChangedInfo
```

<br />

*** ** * ** ***

Class that encapsulates the information that is delivered when `https://developer.android.com/reference/android/app/Activity.html#onPictureInPictureModeChanged(boolean)` is dispatched to a `https://developer.android.com/reference/androidx/core/app/OnPictureInPictureModeChangedProvider`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#PictureInPictureModeChangedInfo(kotlin.Boolean)(boolean isInPictureInPictureMode)` |
| `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#PictureInPictureModeChangedInfo(kotlin.Boolean,android.content.res.Configuration)( boolean isInPictureInPictureMode, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html newConfig )` Construct an instance that contains the new picture-in-picture mode and the new configuration with the new picture-in-picture mode applied. |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#getNewConfig()()` Gets the new `https://developer.android.com/reference/android/content/res/Configuration.html` of the with activity with the state `https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#isInPictureInPictureMode()` applied. |
| `final boolean` | `https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#isInPictureInPictureMode()()` Gets the new picture-in-picture mode. |

## Public constructors

### PictureInPictureModeChangedInfo

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
public PictureInPictureModeChangedInfo(boolean isInPictureInPictureMode)
```

### PictureInPictureModeChangedInfo

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
@RequiresApi(value = 26)
public PictureInPictureModeChangedInfo(
    boolean isInPictureInPictureMode,
    @NonNull Configuration newConfig
)
```

Construct an instance that contains the new picture-in-picture mode and the new configuration with the new picture-in-picture mode applied.

| Parameters |
|---|---|
| `boolean isInPictureInPictureMode` | True if the activity is in picture-in-picture mode. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html newConfig` | The new configuration of the activity with the state {@param isInPictureInPictureMode}. |

## Public methods

### getNewConfig

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
@RequiresApi(value = 26)
public final @NonNull Configuration getNewConfig()
```

Gets the new `https://developer.android.com/reference/android/content/res/Configuration.html` of the with activity with the state `https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#isInPictureInPictureMode()` applied.

Note that this is only valid on devices that are running API 26 (`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O`) or higher.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html` | The new configuration of the activity with the state `https://developer.android.com/reference/androidx/core/app/PictureInPictureModeChangedInfo#isInPictureInPictureMode()`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the new `https://developer.android.com/reference/android/content/res/Configuration.html` is not available (i.e., you are running on a device less that `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O` which is when this information first became available). |

### isInPictureInPictureMode

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
public final boolean isInPictureInPictureMode()
```

Gets the new picture-in-picture mode.

| Returns |
|---|---|
| `boolean` | True if the activity is in picture-in-picture mode. |