set ListView Divider - Android android.widget

Android examples for android.widget:ListView

Description

set ListView Divider

Demo Code

import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.widget.ListView;

public class Main{

    static Drawable gradient = new GradientDrawable(
            GradientDrawable.Orientation.LEFT_RIGHT, new int[] {
                    0x3300FF00, 0xFF00FF00, 0xffffffff });
    public static void setDivider(ListView listView) {
        listView.setDivider(gradient);//from ww  w.  j  a  v a  2  s  . c om
        listView.setDividerHeight(1);

    }

}

Related Tutorials