Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.text.Spannable;
import android.text.SpannableStringBuilder;

public class Main {
    public static void appendSpannable(SpannableStringBuilder builder, String text, Object[] styles) {
        final int from = builder.length();
        builder.append(text);
        final int to = builder.length();

        for (Object style : styles) {
            builder.setSpan(style, from, to, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
    }
}