android.support.v4.widget
Class SearchViewCompat

java.lang.Object
  extended by android.support.v4.widget.SearchViewCompat

public class SearchViewCompat
extends java.lang.Object

Helper for accessing features in android.widget.SearchView introduced after API level 4 in a backwards compatible fashion.


Nested Class Summary
static class SearchViewCompat.OnQueryTextListenerCompat
          Callbacks for changes to the query text.
 
Method Summary
static View newSearchView(Context context)
          Creates a new SearchView.
static void setOnQueryTextListener(View searchView, SearchViewCompat.OnQueryTextListenerCompat listener)
          Sets a listener for user actions within the SearchView.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newSearchView

public static View newSearchView(Context context)
Creates a new SearchView.

Parameters:
context - The Context the view is running in.
Returns:
A SearchView instance if the class is present on the current platform, null otherwise.

setOnQueryTextListener

public static void setOnQueryTextListener(View searchView,
                                          SearchViewCompat.OnQueryTextListenerCompat listener)
Sets a listener for user actions within the SearchView.

Parameters:
searchView - The SearchView in which to register the listener.
listener - the listener object that receives callbacks when the user performs actions in the SearchView such as clicking on buttons or typing a query.