Java tutorial
//package com.java2s; import android.graphics.Color; import android.text.SpannableString; import android.text.style.BackgroundColorSpan; import java.util.List; public class Main { public static SpannableString backgroundColor(SpannableString sequence, List<String> color) { int hex = Color.parseColor(color.get(0)); sequence.setSpan(new BackgroundColorSpan(hex), 0, sequence.length(), 0); return sequence; } }