1

I want to use Android SearchView but, I have a limitation that I can not use Cursor Adapter.

What are the other adapter one can use with SearchView?

My current fallback is to use ListViewPopUp but it has it's own issue of interaction with menu and back key.

VendettaDroid
  • 3,131
  • 2
  • 28
  • 41
  • 1
    "I have a limitation that I can not use Cursor Adapter" -- why? Bear in mind that `Cursor` is an interface, and so you can wrap your own data in something that exposes a `Cursor` if need be. I'll admit that this limitation of `SearchView` and `setSuggestionsAdapter()` seems rather short-sighted on Google's part. Another option would be to fork `SearchView`, creating a modified edition that could work with other adapter types. – CommonsWare Aug 22 '14 at 20:54
  • 1
    Commonsware have explained pretty well how you can tackle the problem. The easiest solution(basically the addition of a for loop in code) would be to wrap your current data in a `MatrixCursor`(and then use it in the required CursorAdapter). – user May 19 '15 at 04:54

1 Answers1

0

@Commonsware is correct. I ended creating custom views which can support my functionality of using adapter and not cursor adapter.

VendettaDroid
  • 3,131
  • 2
  • 28
  • 41