I'm having a problem with a custom ArrayAdapter. The affected code parts consist of a ListView (containing TwoLineListItems) and an extended class of base ArrayAdapter. The ArrayAdapter contains Strings, initialized from ArrayList<String>.

So, I modify the list of strings (basically I apply different sort orders / filters based on class properties outside the ArrayAdapter) and re-set the new strings in the extended ArrayAdapter class by

Now, the ListView does have setTextFilterEnabled(true), which does work as expected as well. BUT: after I have used this filter function (independent of wether I clear the filter or not), the strings in the ArrayAdapter can't be changed any more. The proper data is fed into the clear()/add() function above, but the data in the class doesn't change - If I call this.isEmpty() after this.clear(), it returns false (it does return true before using text filters).

I tried a couple of things (clearTextFilter(), enable / disable textfilter, manually calling notifyDataSetChanged(), keeping a reference to the original ArrayList<String> and changing data in that ArrayList) with no luck at all.

There's a lot of code included, so I didn't post the whole code here ... any ideas someone?

the ArrayFilter of the ArrayAdapter copies the data of the ArrayAdapter and performs the filter on the copied data. You can see this behavior in the method android.widget.ArrayAdapter$ArrayFilter.performFiltering.

is there any way to reset that filter? I did have a look at the internal data of the ArrayAdapter. There is a "mObjects" object, which does contain the data. Before using the filter .clear() does remove all elements of mObjects, after using the filter, mObjects seems to be locked or whatever ...