added in version 25.1.0
belongs to Maven artifact


public class SearchView
extends LinearLayoutCompat implements CollapsibleActionView

   ↳ android.view.View
     ↳ android.view.ViewGroup

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


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


Inherited constants

From class
From class android.view.ViewGroup