refresh ListView - Android User Interface

Android examples for User Interface:ListView

Description

refresh ListView

Demo Code


//package com.java2s;
import android.widget.BaseAdapter;
import android.widget.ListView;

public class Main {
    public static void refreshListView(ListView lv) {
        BaseAdapter adapter = (BaseAdapter) lv.getAdapter();
        if (adapter != null) {
            adapter.notifyDataSetChanged();
        }// w ww.j  av  a  2s  . c o m

        lv.invalidateViews();
        lv.refreshDrawableState();
    }
}

Related Tutorials