# PoolingContainerListener

Artifact: [androidx.customview:customview-poolingcontainer](https://developer.android.com/jetpack/androidx/releases/customview) [View Source](https://cs.android.com/search?q=file:androidx/customview/poolingcontainer/PoolingContainer.kt+class:androidx.customview.poolingcontainer.PoolingContainerListener) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/customview#1.0.0)

*** ** * ** ***


```
public fun interface PoolingContainerListener
```

<br />

*** ** * ** ***

A callback to inform a child View within a container that manages its children's lifecycle outside of the View hierarchy (such as a RecyclerView) when that child should dispose any resources it holds.

This callback is not necessarily triggered if the pooling container is disassociating the View from a particular piece of data (that is, it is *not* an "unbind listener"). It is intended for expensive resources that need to be cached across data items, but need a signal to be disposed of.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `@https://developer.android.com/reference/androidx/annotation/UiThread https://developer.android.com/reference/androidx/customview/poolingcontainer/PoolingContainerListener#onRelease()()` Signals that this view should dispose any resources it may be holding onto, because its container is either discarding the View or has been removed from the hierarchy itself. |

## Public methods

### onRelease

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

```
@UiThread
abstract void onRelease()
```

Signals that this view should dispose any resources it may be holding onto, because its container is either discarding the View or has been removed from the hierarchy itself.

Note: This may be called multiple times. A call to this method does *not* mean the View will not later be reattached.