0

I want to add search history to my SearchView. I found this question. It is rather useful but it looks like I can't handle it this way. First of all I use only fragments in my app while it looks like the solution above requires to create new activity for making search (well maybe I can reuse the same activity using some Intent flags). Also I can't provide search hint bia string resources.

I have fragment with SearchView in actionbar. When user enters search query I just perform web request and display results in the same fragment. I only need to add search history functionality to it. Can this be done completly programmatically?

Community
  • 1
  • 1
Lingviston
  • 5,479
  • 5
  • 35
  • 67
  • Just call setSuggestionsAdapter with a SimpleCursorAdapter that has set custom FilterQueryProvider – pskink Jan 20 '15 at 16:02
  • In your FilterQueryProvider you can comcombine two cursors (historical search results and current search results) by using a MergeCursor – pskink Jan 20 '15 at 16:48

0 Answers0