# AdapterView.OnItemClickListener

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener#pubmethods)  

# AdapterView.OnItemClickListener

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/widget/AdapterView.OnItemClickListener "View this page in Kotlin")\|Java

`
public
static


interface
AdapterView.OnItemClickListener
`  
`


`

|------------------------------------------------|
| android.widget.AdapterView.OnItemClickListener |

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [CharacterPickerDialog](https://developer.android.com/reference/android/text/method/CharacterPickerDialog),[PreferenceScreen](https://developer.android.com/reference/android/preference/PreferenceScreen) |------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [CharacterPickerDialog](https://developer.android.com/reference/android/text/method/CharacterPickerDialog) | Dialog for choosing accented characters related to a base character.                                                                                                                                                                                                                                                                                                                            | | [PreferenceScreen](https://developer.android.com/reference/android/preference/PreferenceScreen)            | *This class was deprecated in API level 29. Use the[AndroidX](https://developer.android.com/jetpack/androidx)[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary)for consistent behavior across all devices. For more information on using the AndroidX Preference Library see[Settings](https://developer.android.com/guide/topics/ui/settings).* | |

<br />

*** ** * ** ***

Interface definition for a callback to be invoked when an item in this AdapterView has been clicked.

## Summary

|                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                       ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onItemClick](https://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener#onItemClick(android.widget.AdapterView<?>,%20android.view.View,%20int,%20long))`(`[AdapterView](https://developer.android.com/reference/android/widget/AdapterView)`<?> parent, `[View](https://developer.android.com/reference/android/view/View)` view, int position, long id) ` Callback method to be invoked when an item in this AdapterView has been clicked. |

## Public methods

### onItemClick

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void onItemClick (AdapterView<?> parent, 
                View view, 
                int position, 
                long id)
```

Callback method to be invoked when an item in this AdapterView has been clicked.

Implementers can call getItemAtPosition(position) if they need to access the data associated with the selected item.

<br />

|                                                        Parameters                                                         ||
|------------|---------------------------------------------------------------------------------------------------------------|
| `parent`   | `AdapterView`: The AdapterView where the click happened. <br />                                               |
| `view`     | `View`: The view within the AdapterView that was clicked (this will be a view provided by the adapter) <br /> |
| `position` | `int`: The position of the view in the adapter. <br />                                                        |
| `id`       | `long`: The row id of the item that was clicked. <br />                                                       |