Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

# AppInteractionSession.LifecycleListener

*** ** * ** ***


`
public
static


interface
AppInteractionSession.LifecycleListener
`


`


`

|---|
| android.app.AppInteractionSession.LifecycleListener |

<br />

*** ** * ** ***

Listener for session lifecycle events.

## Summary

| ### Public methods ||
|---|---|
| ` default void` | ` https://developer.android.com/reference/android/app/AppInteractionSession.LifecycleListener#onAppInteractionSessionClosed(android.app.AppInteractionSession,%20int)(https://developer.android.com/reference/android/app/AppInteractionSession session, int reason) ` Called when the session is closed. |

## Public methods

### onAppInteractionSessionClosed

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onAppInteractionSessionClosed (AppInteractionSession session, 
                int reason)
```

Called when the session is closed.

A session may be closed explicitly via `https://developer.android.com/reference/android/app/AppInteractionSession#close()` or
implicitly by the system when the session reaches its maximum duration timeout.

If the session is already closed, the listener will be invoked immediately.

<br />

| Parameters ||
|---|---|
| `session` | `AppInteractionSession`: The session that is closed. This value cannot be `null`. <br /> |
| `reason` | `int`: The reason why the session is closed. Value is one of the following: - `https://developer.android.com/reference/android/app/AppInteractionSession#CLOSE_REASON_UNKNOWN` - `https://developer.android.com/reference/android/app/AppInteractionSession#CLOSE_REASON_TIMEOUT` - `https://developer.android.com/reference/android/app/AppInteractionSession#CLOSE_REASON_CALLER_INITIATED` |