# WindowAreaSessionPresenter

# WindowAreaSessionPresenter

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/window/area/WindowAreaSessionPresenter "View this page in Java")

<br />

```
@ExperimentalWindowApi
interface WindowAreaSessionPresenter : WindowAreaSession
```

<br />

*** ** * ** ***

A container that allows getting access to and showing content on a window area. The container is provided from[WindowAreaPresentationSessionCallback](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaPresentationSessionCallback)when a requested session becomes active. The presentation can be automatically dismissed by the system when the user leaves the primary application window, or can be closed by calling[WindowAreaSessionPresenter.close](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter#close()).  

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

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [setContentView](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter#setContentView(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`)` Sets a[View](https://developer.android.com/reference/android/view/View.html)to show on a window area. |

|                              ### Public properties                              |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Context](https://developer.android.com/reference/android/content/Context.html) | [context](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter#context()) Returns the[Context](https://developer.android.com/reference/android/content/Context.html)associated with the window area.                                                                                                                               |
| [Window](https://developer.android.com/reference/android/view/Window.html)`?`   | [window](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSessionPresenter#window()) Returns the[Window](https://developer.android.com/reference/android/view/Window.html)associated with the active presentation window area or null if there is no[Window](https://developer.android.com/reference/android/view/Window.html)currently active. |

|                                                                                                                                                                                                                                                                                                                               ### Inherited functions                                                                                                                                                                                                                                                                                                                               |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.window.area.WindowAreaSession](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSession) |-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [close](https://developer.android.com/reference/kotlin/androidx/window/area/WindowAreaSession#close())`()` Closes the active session, no-op if the session is not currently active. | |

## Public functions

### setContentView

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

```
fun setContentView(view: View): Unit
```

Sets a[View](https://developer.android.com/reference/android/view/View.html)to show on a window area. After setting the view the system can turn on the corresponding display and start showing content.  

## Public properties

### context

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

```
val context: Context
```

Returns the[Context](https://developer.android.com/reference/android/content/Context.html)associated with the window area.  

### window

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

```
val window: Window?
```

Returns the[Window](https://developer.android.com/reference/android/view/Window.html)associated with the active presentation window area or null if there is no[Window](https://developer.android.com/reference/android/view/Window.html)currently active. This could occur if the presenter has already been dismissed, and there is no expectation that the[Window](https://developer.android.com/reference/android/view/Window.html)would become non-null at a later point. This API can be used to directly access parts of the[Window](https://developer.android.com/reference/android/view/Window.html)API that are not available through the[Context](https://developer.android.com/reference/android/content/Context.html)provided.