Show Error Message SpannableStringBuilder - Android android.text

Android examples for android.text:SpannableStringBuilder

Description

Show Error Message SpannableStringBuilder

Demo Code


//package com.java2s;
import android.graphics.Color;

import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;

public class Main {
    public static SpannableStringBuilder ShowErrMsg(
            CharSequence charSequence) {
        ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(
                Color.parseColor("#6a645a"));
        SpannableStringBuilder ssbuilder = new SpannableStringBuilder(
                charSequence);//from   ww w .  j av  a  2s. c o m
        ssbuilder.setSpan(foregroundColorSpan, 0, charSequence.length(), 0);
        return ssbuilder;

    }
}

Related Tutorials