Stay organized with collections
Save and categorize content based on your preferences.
View.OnClickListener
public
static
interface
View.OnClickListener
android.view.View.OnClickListener
|
Known indirect subclasses
CharacterPickerDialog |
Dialog for choosing accented characters related to a base character.
|
KeyboardView |
This class was deprecated
in API level 29.
This class is deprecated because this is just a convenient UI widget class that
application developers can re-implement on top of existing public APIs. If you have
already depended on this class, consider copying the implementation from AOSP into
your project or re-implementing a similar widget by yourselves
|
QuickContactBadge |
Widget used to show an image with the standard QuickContact badge
and on-click behavior.
|
|
Interface definition for a callback to be invoked when a view is clicked.
Summary
Public methods |
abstract
void
|
onClick(View v)
Called when a view has been clicked.
|
Public methods
onClick
public abstract void onClick (View v)
Called when a view has been clicked.
Parameters |
v |
View : The view that was clicked. |
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,["# View.OnClickListener\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nView.OnClickListener\n====================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/view/View.OnClickListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nView.OnClickListener\n`\n\n\n`\n\n\n`\n\n|-----------------------------------|\n| android.view.View.OnClickListener |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [CharacterPickerDialog](/reference/android/text/method/CharacterPickerDialog), [KeyboardView](/reference/android/inputmethodservice/KeyboardView), [QuickContactBadge](/reference/android/widget/QuickContactBadge) |-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [CharacterPickerDialog](/reference/android/text/method/CharacterPickerDialog) | Dialog for choosing accented characters related to a base character. | | [KeyboardView](/reference/android/inputmethodservice/KeyboardView) | *This class was deprecated in API level 29. This class is deprecated because this is just a convenient UI widget class that application developers can re-implement on top of existing public APIs. If you have already depended on this class, consider copying the implementation from AOSP into your project or re-implementing a similar widget by yourselves* | | [QuickContactBadge](/reference/android/widget/QuickContactBadge) | Widget used to show an image with the standard QuickContact badge and on-click behavior. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when a view is clicked.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onClick](/reference/android/view/View.OnClickListener#onClick(android.view.View))`(`[View](/reference/android/view/View)` v) ` Called when a view has been clicked. |\n\nPublic methods\n--------------\n\n### onClick\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClick (View v)\n```\n\nCalled when a view has been clicked.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|-------------------------------------------|\n| `v` | `View`: The view that was clicked. \u003cbr /\u003e |"]]