Code example for CheckedTextView

Methods: setBackgroundColor

                // Find the text view from our interface 
                CheckedTextView tv = (CheckedTextView) view.findViewById( );
                // Color the text view background using our color 
                tv.setBackgroundColor( m_colors[position] );
            return view;
    public ColorPickerPreference( Context context, AttributeSet attrs )
        super(context, attrs);
        m_colors = new int[] {Color.BLACK, Color.DKGRAY, Color.GRAY, Color.LTGRAY,
        											   Color.WHITE, Color.RED, Color.GREEN, Color.BLUE,
        											   Color.YELLOW, Color.CYAN, Color.MAGENTA};
Experience pair programming with AI  Get Codota for Java