In the Android Documentation, in topic 'Adding Custom Suggestions' for Search feature, it says that:
When the user starts typing into the search dialog or search widget, the system queries your content provider for suggestions by calling
query()
each time a letter is typed.
Also, in the documentation on SearchView.OnQueryTextListener
interface (which is supposed to provide Callbacks for changes to the query text), the method onQueryTextChange (String newText)
is
Called when the query text is changed by the user.
I am trying to implement SearchView.OnQueryTextListener
to make sure that the Loader is restarted in the call to onQueryTextChange (String newText)
to deal with the "next" query because Android does not execute the query again when the query-text changes after first search(i.e. once a search has already been performed once).
My question is: If both Custom Search suggestions and SearchView.OnQueryTextListener
interface have been implemented, then, which of these two methods query()
(called by the Android system) and onQueryTextChange (String newText)
(callback method) is called when the query text changes in SearchView widget?