Code example for UnderlineSpan

0
    } 
 
    @Override 
    public void setText(CharSequence text, BufferType type) {
        SpannableString content = new SpannableString(text + " \u00BB");
        content.setSpan(new UnderlineSpan(), 0, text.length(), 0);
 
        super.setText(content, BufferType.SPANNABLE);
    } 
 
    @Override 
    public void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
        super.onFocusChanged(focused, direction, previouslyFocusedRect);
 
        if (focused == mFocusApplied) {
            return; 
        } 
        mFocusApplied = focused;
 
        CharSequence text = getText();
        if (text instanceof SpannableString) {