thest1 / LazyList

Lazy load of images in Android
http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012
MIT License
1.2k stars 497 forks source link

LazyList update(refresh) Listview #44

Open sercanerfidan opened 9 years ago

sercanerfidan commented 9 years ago

Hi,

I m trying to use searchView with LazyList. In my lazyAdapter I m updating my arraylist , this works smoothly but my listview doesn't update with arrayList. This is my filer method. I suppose notifyDataSetChanged does not work.Please help how can I refresh my listview?

public void filter(String charText) {

    charText = charText.toLowerCase(Locale.getDefault());
    //list.clear();
    list = new ArrayList<HashMap<String, String>>();
    if (charText.length() == 0) {
        list.addAll(arraylist);
    } 
    else 
    {
        for (HashMap<String, String> map : arraylist) 
        {
            if (map.get("radio").toString().toLowerCase(Locale.getDefault()).contains(charText)) 
            {
                list.add(map);
            }
        }
    }
    notifyDataSetChanged();
}