Stay organized with collections
Save and categorize content based on your preferences.
OnChildClickListener
interface OnChildClickListener
Known Direct Subclasses
ExpandableListActivity |
An activity that displays an expandable list of items by binding to a data source implementing the ExpandableListAdapter, and exposes event handlers when the user selects an item.
|
|
Interface definition for a callback to be invoked when a child in this expandable list has been clicked.
Summary
Public methods |
abstract Boolean |
Callback method to be invoked when a child in this expandable list has been clicked.
|
Public methods
onChildClick
abstract fun onChildClick(
parent: ExpandableListView!,
v: View!,
groupPosition: Int,
childPosition: Int,
id: Long
): Boolean
Callback method to be invoked when a child in this expandable list has been clicked.
Parameters |
parent |
ExpandableListView!: The ExpandableListView where the click happened |
v |
View!: The view within the expandable list/ListView that was clicked |
groupPosition |
Int: The group position that contains the child that was clicked |
childPosition |
Int: The child position within the group |
id |
Long: The row id of the child that was clicked |
Return |
Boolean |
True if the click was handled |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ExpandableListView.OnChildClickListener\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnChildClickListener\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/ExpandableListView.OnChildClickListener \"View this page in Java\") \n\n```\ninterface OnChildClickListener\n```\n\n|-------------------------------------------------------------|\n| [android.widget.ExpandableListView.OnChildClickListener](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [ExpandableListActivity](../app/ExpandableListActivity.html#) |---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [ExpandableListActivity](../app/ExpandableListActivity.html#) | An activity that displays an expandable list of items by binding to a data source implementing the ExpandableListAdapter, and exposes event handlers when the user selects an item. | |\n\nInterface definition for a callback to be invoked when a child in this expandable list has been clicked.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onChildClick](#onChildClick(android.widget.ExpandableListView,%20android.view.View,%20kotlin.Int,%20kotlin.Int,%20kotlin.Long))`(`parent:` `[ExpandableListView](/reference/kotlin/android/widget/ExpandableListView)!`, `v:` `[View](../view/View.html#)!`, `groupPosition:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `childPosition:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `id:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Callback method to be invoked when a child in this expandable list has been clicked. |\n\nPublic methods\n--------------\n\n### onChildClick\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onChildClick(\n parent: ExpandableListView!, \n v: View!, \n groupPosition: Int, \n childPosition: Int, \n id: Long\n): Boolean\n```\n\nCallback method to be invoked when a child in this expandable list has been clicked.\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | [ExpandableListView](/reference/kotlin/android/widget/ExpandableListView)!: The ExpandableListView where the click happened |\n| `v` | [View](../view/View.html#)!: The view within the expandable list/ListView that was clicked |\n| `groupPosition` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The group position that contains the child that was clicked |\n| `childPosition` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The child position within the group |\n| `id` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The row id of the child that was clicked |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | True if the click was handled |"]]