I have a ListView on my Android application in which I am dynamically changing data. I use the onFilterComplete()
method to modify the contents of a ListView.
Pre Ice Cream Sandwhich, which works in the following code:
if(adapter != null) { adapter.notifyDataSetInvalidated(); lview3.invalidateViews(); adapter.getFilter().filter(aa1.getItem(item), new Filter.FilterListener() { public void onFilterComplete(int count) { adapter.notifyDataSetChanged(); if(lview3.getCount() == 0){ lview3.setVisibility(View.GONE); } else{ lview3.setVisibility(View.VISIBLE); } }});
However, on Ice Cream Sandwhich, when I use a filter, the screen does not refresh properly. If the filter returns several records that are smaller than the previous ListView, then the old list data is still visible in the background, according to this screenshot:
In the screenshot you can see where the first entry is in the ListView, that’s all that should be visible, you can see where the previous results are still visible from below, they are just visible, that they don’t function, they cannot be involved in them, as if the screen did not refresh properly.
When I select the home button to leave the application using the main screen, and return everything as it should, as shown in the following screenshot:
Is there anything else I have to implement in order to properly update the ListView on Ice Cream Sandwhich? Has anyone else encountered a similar problem?
What works for me is excellent until ICS.
source share