Java android.widget SearchView fields, constructors, methods, implement or subclass

Example usage for Java android.widget SearchView fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget SearchView.

The text is from its open source code.

Implementation

android.widget.SearchView has the following implementations.
Click this link to see all its implementation.

Constructor

Method

voidclearFocus()
TfindViewById(@IdRes int id)
Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy.
ContextgetContext()
Returns the context the view is running in, through which it can access the current theme, resources, etc.
ResourcesgetResources()
Returns the resources associated with this view.
intgetSuggestionCommitIconResId()
intgetSuggestionRowLayout()
IBindergetWindowToken()
Retrieve a unique token identifying the window this view is attached to.
booleanisIconified()
Returns the current iconified state of the SearchView.
voidonActionViewCollapsed()
voidonActionViewExpanded()
booleanrequestFocus()
Call this to try to give focus to a specific view or to one of its descendants.
booleanrequestFocusFromTouch()
Call this to try to give focus to a specific view or to one of its descendants.
voidsetFocusable(boolean focusable)
Set whether this view can receive the focus.
voidsetIconified(boolean iconify)
Iconifies or expands the SearchView.
voidsetIconifiedByDefault(boolean iconified)
Sets the default or resting state of the search field.
voidsetImeOptions(int imeOptions)
Sets the IME options on the query text field.
voidsetMaxWidth(int maxpixels)
Makes the view at most this many pixels wide
voidsetOnClickListener(@Nullable OnClickListener l)
Register a callback to be invoked when this view is clicked.
voidsetOnCloseListener(OnCloseListener listener)
Sets a listener to inform when the user closes the SearchView.
voidsetOnFocusChangeListener(OnFocusChangeListener l)
Register a callback to be invoked when focus of this view changed.
voidsetOnQueryTextFocusChangeListener(OnFocusChangeListener listener)
Sets a listener to inform when the focus of the query text field changes.
voidsetOnQueryTextListener(OnQueryTextListener listener)
Sets a listener for user actions within the SearchView.
voidsetOnSearchClickListener(OnClickListener listener)
Sets a listener to inform when the search button is pressed.
voidsetOnSuggestionListener(OnSuggestionListener listener)
Sets a listener to inform when a suggestion is focused or clicked.
voidsetQuery(CharSequence query, boolean submit)
Sets a query string in the text field and optionally submits the query as well.
voidsetQueryHint(@Nullable CharSequence hint)
Sets the hint text to display in the query text field.
voidsetQueryRefinementEnabled(boolean enable)
Specifies if a query refinement button should be displayed alongside each suggestion or if it should depend on the flags set in the individual items retrieved from the suggestions provider.
voidsetSearchableInfo(SearchableInfo searchable)
Sets the SearchableInfo for this SearchView.
voidsetSubmitButtonEnabled(boolean enabled)
Enables showing a submit button when the query is non-empty.
voidsetSuggestionsAdapter(CursorAdapter adapter)
You can set a custom adapter if you wish.
voidsetVisibility(@Visibility int visibility)
Set the visibility state of this view.