belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1
SearchView
public
class
SearchView
extends LinearLayoutCompat
implements
CollapsibleActionView
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.support.v7.widget.LinearLayoutCompat | |||
↳ | android.support.v7.widget.SearchView |
A widget that provides a user interface for the user to enter a search query and submit a request to a search provider. Shows a list of query suggestions or results, if available, and allows the user to pick a suggestion or result to launch into.
Note: This class is included in the support library for compatibility
with API level 7 and higher. If you're developing your app for API level 11 and higher
only, you should instead use the framework SearchView
class.
When the SearchView is used in an ActionBar
as an action view, it's collapsed by default, so you must provide an icon for the action.
If you want the search field to always be visible, then call
setIconifiedByDefault(false)
.
Developer Guides
For information about using SearchView
, read the
Search API guide.
Additional information about action views is also available in the <Action Bar API guide
See also:
Summary
Nested classes | |
---|---|
interface |
SearchView.OnCloseListener
|
interface |
SearchView.OnQueryTextListener
Callbacks for changes to the query text. |
interface |
SearchView.OnSuggestionListener
Callback interface for selection events on suggestions. |
XML attributes | |
---|---|
SearchView_android_imeOptions |
|
SearchView_android_inputType |
|
SearchView_android_maxWidth |
|
SearchView_iconifiedByDefault |
|
SearchView_queryHint |
Inherited constants |
---|
![]()
android.support.v7.widget.LinearLayoutCompat
|
![]()
android.view.ViewGroup
|
![]()
android.view.View
|