Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}