The Android Developer Challenge is back! Submit your idea before December 2.

SearchResultProvider

interface SearchResultProvider
androidx.leanback.app.SearchSupportFragment.SearchResultProvider

Search API to be provided by the application.

Summary

Public methods

abstract ObjectAdapter!

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.

abstract Boolean

Method invoked when the search query is updated.

abstract Boolean

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.

Public methods

getResultsAdapter

abstract fun getResultsAdapter(): ObjectAdapter!

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 SearchSupportFragment to update the results.

Return
ObjectAdapter!: ObjectAdapter The result object adapter.

onQueryTextChange

abstract fun onQueryTextChange(newQuery: String!): Boolean

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 String!: The current search query.
Return
Boolean: whether the results changed as a result of the new query.

onQueryTextSubmit

abstract fun onQueryTextSubmit(query: String!): Boolean

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 String!: The query entered.
Return
Boolean: whether the results changed as a result of the query.