Example usage for Java android.widget SearchView fields, constructors, methods, implement or subclass
The text is from its open source code.
void | clearFocus() |
T | findViewById(@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. |
Context | getContext() Returns the context the view is running in, through which it can access the current theme, resources, etc. |
Resources | getResources() Returns the resources associated with this view. |
int | getSuggestionCommitIconResId() |
int | getSuggestionRowLayout() |
IBinder | getWindowToken() Retrieve a unique token identifying the window this view is attached to. |
boolean | isIconified() Returns the current iconified state of the SearchView. |
void | onActionViewCollapsed() |
void | onActionViewExpanded() |
boolean | requestFocus() Call this to try to give focus to a specific view or to one of its descendants. |
boolean | requestFocusFromTouch() Call this to try to give focus to a specific view or to one of its descendants. |
void | setFocusable(boolean focusable) Set whether this view can receive the focus. |
void | setIconified(boolean iconify) Iconifies or expands the SearchView. |
void | setIconifiedByDefault(boolean iconified) Sets the default or resting state of the search field. |
void | setImeOptions(int imeOptions) Sets the IME options on the query text field. |
void | setMaxWidth(int maxpixels) Makes the view at most this many pixels wide |
void | setOnClickListener(@Nullable OnClickListener l) Register a callback to be invoked when this view is clicked. |
void | setOnCloseListener(OnCloseListener listener) Sets a listener to inform when the user closes the SearchView. |
void | setOnFocusChangeListener(OnFocusChangeListener l) Register a callback to be invoked when focus of this view changed. |
void | setOnQueryTextFocusChangeListener(OnFocusChangeListener listener) Sets a listener to inform when the focus of the query text field changes. |
void | setOnQueryTextListener(OnQueryTextListener listener) Sets a listener for user actions within the SearchView. |
void | setOnSearchClickListener(OnClickListener listener) Sets a listener to inform when the search button is pressed. |
void | setOnSuggestionListener(OnSuggestionListener listener) Sets a listener to inform when a suggestion is focused or clicked. |
void | setQuery(CharSequence query, boolean submit) Sets a query string in the text field and optionally submits the query as well. |
void | setQueryHint(@Nullable CharSequence hint) Sets the hint text to display in the query text field. |
void | setQueryRefinementEnabled(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. |
void | setSearchableInfo(SearchableInfo searchable) Sets the SearchableInfo for this SearchView. |
void | setSubmitButtonEnabled(boolean enabled) Enables showing a submit button when the query is non-empty. |
void | setSuggestionsAdapter(CursorAdapter adapter) You can set a custom adapter if you wish. |
void | setVisibility(@Visibility int visibility) Set the visibility state of this view. |