Currently, I tend to use SearchView
in ActionBar
's action view, to perform network query when user performs typing. The returned network result will tend present in SearchView
drop down with custom layout.
After looking at
- Converting an ArrayAdapter to CursorAdapter for use in a SearchView
- http://ramannanda.blogspot.com/2014/10/android-searchview-integration-with.html
I think I can achieve my purpose by using the following steps.
- Capture user input in
SearchView.OnQueryTextListener
, and perform async network query. - Once we get result from async network query, build
MatrixCursor
to hold network query result. - Build
SimpleCursorAdapter
around MatrixCursor, for custom drop down layout.
However, after further reading
- http://www.edumobile.org/android/action-bar-search-view/
- http://karanbalkar.com/2014/06/tutorial-84-implement-searchview-in-android/
- http://developer.android.com/training/search/setup.html
I realize another way to capture user input, is through SearchManager
, by setting up an intent filter Activity
, of android.intent.action.SEARCH
.
I was wondering, for my use case, which is the more appropriate method? Should we capture user input via SearchView.OnQueryTextListener, or intent filter Activity
?