1

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

I think I can achieve my purpose by using the following steps.

  1. Capture user input in SearchView.OnQueryTextListener, and perform async network query.
  2. Once we get result from async network query, build MatrixCursor to hold network query result.
  3. Build SimpleCursorAdapter around MatrixCursor, for custom drop down layout.

However, after further reading

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?

Community
  • 1
  • 1
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
  • What approach did you end up taking? I went down the SearchView.OnQueryTexListener route and fired a loader to update the SearchView's suggestions adapter. – WindsurferOak Sep 08 '15 at 03:04

0 Answers0