# WindowAreaPresentationSessionCallback

Artifact: [androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/area/WindowAreaPresentationSessionCallback.kt+class:androidx.window.area.WindowAreaPresentationSessionCallback) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/window#1.2.0)

*** ** * ** ***


```
@ExperimentalWindowApi
interface WindowAreaPresentationSessionCallback
```

<br />

*** ** * ** ***

A callback to notify about the lifecycle of a window area presentation session.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaController#presentContentOnWindowArea(androidx.window.area.WindowAreaToken,android.app.Activity,java.util.concurrent.Executor,androidx.window.area.WindowAreaPresentationSessionCallback)` |   |

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaPresentationSessionCallback#onContainerVisibilityChanged(kotlin.Boolean)(isVisible: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Notifies about changes in visibility of a container that can hold the app content to show in the window area. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaPresentationSessionCallback#onSessionEnded(kotlin.Throwable)(t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?)` Notifies about an end of a presentation session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaPresentationSessionCallback#onSessionStarted(androidx.window.area.WindowAreaSessionPresenter)(session: https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter)` Notifies about a start of a presentation session. |

## Public functions

### onContainerVisibilityChanged

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

```
fun onContainerVisibilityChanged(isVisible: Boolean): Unit
```

Notifies about changes in visibility of a container that can hold the app content to show in the window area. Notification of the container being visible is guaranteed to occur after `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaPresentationSessionCallback#onSessionStarted(androidx.window.area.WindowAreaSessionPresenter)` has been called. The container being no longer visible is guaranteed to occur before `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaPresentationSessionCallback#onSessionEnded(kotlin.Throwable)`.

If content was never presented, then this method will never be called.

### onSessionEnded

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

```
fun onSessionEnded(t: Throwable?): Unit
```

Notifies about an end of a presentation session. The presentation and any app-provided content in the window area is removed.

| Parameters |
|---|---|
| `t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` to provide information on if the session was ended due to an error. This will only occur if a session is attempted to be enabled when it is not available, but can be expanded to alert for more errors in the future. |

### onSessionStarted

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

```
fun onSessionStarted(session: WindowAreaSessionPresenter): Unit
```

Notifies about a start of a presentation session. Provides a reference to `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter` to allow an application to customize a presentation when the session starts. The `https://developer.android.com/reference/android/content/Context.html` provided from the `https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter` should be used to inflate or make any UI decisions around the presentation `https://developer.android.com/reference/android/view/View.html` that should be shown in that area.