Code example for CheckedTextView

Methods: setBackgroundColor

0
            { 
                // Find the text view from our interface 
                CheckedTextView tv = (CheckedTextView) view.findViewById( android.R.id.text1 );
                 
                // 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};
         
        m_resmgr = context.getResources();