How to override filter in android's ArrayAdapter?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-04-19T23:14:37Z Indexed on 2010/04/19 23:23 UTC
Read the original article Hit count: 1034

Filed under:
|
|

I have an ArrayAdapter wrapped around an ArrayList of custom objects. I'd like to write a custom filter for that adapter so that when I call getListAdapter().getFilter().filter("abc") the list will get filtered by an arbitrary transformation of "abc".

I thought I would just try to override ArrayAdapter.getFilter(), but that requires I re-implement the private ArrayAdapter.ArrayFilter which requires access to a bunch of ArrayAdapter's private instances.

What's the simplest way to do this?

© Stack Overflow or respective owner

Related posts about android

Related posts about arrayadapter