Code example for CheckedTextView

Methods: setTextsetTextSizesetTypeface

                // Find the text view from our interface 
                CheckedTextView tv = (CheckedTextView) view.findViewById( );
                // Replace the string with the current font name using our typeface 
                Typeface tface = Typeface.createFromFile( m_fontPaths.get( position ) );
                tv.setTypeface( tface );
                // If you want to make the selected item having different foreground or background color, 
                // be aware of themes. In some of them your foreground color may be the background color. 
                // So we don't mess with anything here and just add the extra stars to have the selected 
                // font to stand out. 
                tv.setText( m_fontNames.get( position ) );
            return view;
    public FontPreference( Context context, AttributeSet attrs )
Stop searching for code, let great code find you!  Add Codota to your java IDE