update Row View - Android android.widget

Android examples for android.widget:ListView

Description

update Row View

Demo Code

import android.view.View;
import android.widget.GridView;
import android.widget.ListView;

public class Main{

    public static void updateRowView(ListView list, Object object) {
        int start = list.getFirstVisiblePosition();
        for (int i = start, j = list.getLastVisiblePosition(); i <= j; i++) {
            if (object == list.getItemAtPosition(i)) {
                View view = list.getChildAt(i - start);
                list.getAdapter().getView(i, view, list);
                break;
            }//from   w w  w  .  j  a  v a  2 s  . com
        }
    }
    public static void updateRowView(ListView list, int position) {
        View view = list.getChildAt(position);
        list.getAdapter().getView(position, view, list);
    }

}

Related Tutorials