# OnChildSelectedListener

Artifact: [androidx.leanback:leanback-grid](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/OnChildSelectedListener.java+class:androidx.leanback.widget.OnChildSelectedListener) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.0.0)

*** ** * ** ***


```
interface OnChildSelectedListener
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/leanback/widget/OnChildViewHolderSelectedListener`

Interface for receiving notification when a child of this ViewGroup has been selected.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[onChildSelected](https://developer.android.com/reference/kotlin/androidx/leanback/widget/OnChildSelectedListener#onChildSelected(android.view.ViewGroup,android.view.View,int,long))(parent: https://developer.android.com/reference/android/view/ViewGroup.html, view: https://developer.android.com/reference/android/view/View.html?, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` **This function is deprecated.** Deprecated in Java |

## Public functions

### onChildSelected

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

```
fun [onChildSelected](https://developer.android.com/reference/kotlin/androidx/leanback/widget/OnChildSelectedListener#onChildSelected(android.view.ViewGroup,android.view.View,int,long))(parent: ViewGroup, view: View?, position: Int, id: Long): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Callback method to be invoked when a child of this ViewGroup has been selected.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewGroup.html` | The ViewGroup where the selection happened. |
| `view: https://developer.android.com/reference/android/view/View.html?` | The view within the ViewGroup that is selected, or null if no view is selected. |
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The position of the view in the adapter, or NO_POSITION if no view is selected. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The id of the child that is selected, or NO_ID if no view is selected. |