set SpannableString Letter Color - Android Graphics

Android examples for Graphics:Spannable Color

Description

set SpannableString Letter Color

Demo Code


//package com.java2s;

import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;

public class Main {
    private static void setLetterColor(SpannableString string,
            int position, int color) {
        string.setSpan(new ForegroundColorSpan(color), position,
                position + 1, 0);/*ww  w  .jav  a 2 s . co  m*/
    }
}

Related Tutorials