1

I have activity with ListView. That listView contains imageView and two textViews (aka first and last names). I want to organize searching with this listView by one of textView (e.g. by last name). How can I implement that?

I found that Quick Search Box can be used but I didn't understand how to work with it.

Help, plz :)

davs
  • 9,226
  • 8
  • 41
  • 54

1 Answers1

1

You can use setTextFilterEnabled(boolean) method.

If it does not solve your problem then you can also define your own filter.

For this please see this post android-how-do-i-overwrite-the-filter-for-my-arrayadapter

Hope this helps !!

Community
  • 1
  • 1
Vasu
  • 4,862
  • 8
  • 42
  • 48
  • yes, I can do filtering this way, but currently I don't know about gui implementatio of typing the search keyword. I know that android has Quick Search box, which has its own dialog for typing search keyword. It would be better to use it instead of using filtering (or maybe find a way to link QSB and List filtering). Do you have any suggestions about this? – davs May 18 '10 at 16:40
  • I mean This way very useful for devices with hardware keyboards .. but QSB is effective for devices without hardware keyboards ... so I think it would be better to implement QSB, but I found no way how can I do that – davs May 18 '10 at 17:30
  • I found a way to show software keyboard, using which I can use filtering: InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); inputMgr.toggleSoftInput(0, 0); – davs May 20 '10 at 13:14