Stay organized with collections
Save and categorize content based on your preferences.
interface SearchView.OnCloseListener
Summary
Public functions |
Boolean |
The user is attempting to close the SearchView.
|
Public functions
fun onClose(): Boolean
The user is attempting to close the SearchView.
Returns |
Boolean |
true if the listener wants to override the default behavior of clearing the text field and dismissing it, 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-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# SearchView.OnCloseListener\n==========================\n\nArtifact: [androidx.appcompat:appcompat](/jetpack/androidx/releases/appcompat) \n[View Source](https://cs.android.com/search?q=file:androidx/appcompat/widget/SearchView.java+class:androidx.appcompat.widget.SearchView.OnCloseListener) \nAdded in [1.1.0](/jetpack/androidx/releases/appcompat#1.1.0)\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/appcompat/widget/SearchView.OnCloseListener \"View this page in Java\")\n\n\n```\ninterface SearchView.OnCloseListener\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public functions |\n|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [onClose](/reference/kotlin/androidx/appcompat/widget/SearchView.OnCloseListener#onClose())`()` The user is attempting to close the SearchView. |\n\nPublic functions\n----------------\n\n### onClose\n\nAdded in [1.1.0](/jetpack/androidx/releases/appcompat#1.1.0) \n\n```\nfun onClose(): Boolean\n```\n\nThe user is attempting to close the SearchView. \n\n| Returns |\n|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the listener wants to override the default behavior of clearing the text field and dismissing it, false otherwise. |"]]