public interface

SearchFragment.SearchResultProvider

 androidx.leanback.app.SearchFragment.SearchResultProvider

Overview

Search API to be provided by the application.

Summary

Methods
public ObjectAdaptergetResultsAdapter()

Method invoked some time prior to the first call to onQueryTextChange to retrieve an ObjectAdapter that will contain the results to future updates of the search query.

public booleanonQueryTextChange(java.lang.String newQuery)

Method invoked when the search query is updated.

public booleanonQueryTextSubmit(java.lang.String query)

Method invoked when the search query is submitted, either by dismissing the keyboard, pressing search or next on the keyboard or when voice has detected the end of the query.

Methods

public ObjectAdapter getResultsAdapter()

Method invoked some time prior to the first call to onQueryTextChange to retrieve an ObjectAdapter that will contain the results to future updates of the search query.

As results are retrieved, the application should use the data set notification methods on the ObjectAdapter to instruct the SearchFragment to update the results.

Returns:

ObjectAdapter The result object adapter.

public boolean onQueryTextChange(java.lang.String newQuery)

Method invoked when the search query is updated.

This is called as soon as the query changes; it is up to the application to add a delay before actually executing the queries if needed.

This method might not always be called before onQueryTextSubmit gets called, in particular for voice input.

Parameters:

newQuery: The current search query.

Returns:

whether the results changed as a result of the new query.

public boolean onQueryTextSubmit(java.lang.String query)

Method invoked when the search query is submitted, either by dismissing the keyboard, pressing search or next on the keyboard or when voice has detected the end of the query.

Parameters:

query: The query entered.

Returns:

whether the results changed as a result of the query.