Stay organized with collections
Save and categorize content based on your preferences.
OnContextClickListener
interface OnContextClickListener
Interface definition for a callback to be invoked when a view is context clicked.
Summary
Public methods |
abstract Boolean |
Called when a view is context clicked.
|
Public methods
onContextClick
abstract fun onContextClick(v: View!): Boolean
Called when a view is context clicked.
Parameters |
v |
View!: The view that has been context clicked. |
Return |
Boolean |
true if the callback consumed the context click, false otherwise. |
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.OnContextClickListener\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnContextClickListener\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/View.OnContextClickListener \"View this page in Java\") \n\n```\ninterface OnContextClickListener\n```\n\n|-----------------------------------------------|\n| [android.view.View.OnContextClickListener](#) |\n\nInterface definition for a callback to be invoked when a view is context clicked.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onContextClick](#onContextClick(android.view.View))`(`v:` `[View](/reference/kotlin/android/view/View)!`)` Called when a view is context clicked. |\n\nPublic methods\n--------------\n\n### onContextClick\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onContextClick(v: View!): Boolean\n```\n\nCalled when a view is context clicked.\n\n| Parameters ||\n|-----|---------------------------------------------------------------------------------------|\n| `v` | [View](/reference/kotlin/android/view/View)!: The view that has been context clicked. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the callback consumed the context click, false otherwise. |"]]