Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.text.SpannableString;
import android.text.Spanned;

import android.text.style.TextAppearanceSpan;

import android.widget.TextView;

public class Main {

    public static void SpannableforStrUtil(Context mContext, String spannableString, TextView textView, int style,
            int index) {

        SpannableString styledText1 = new SpannableString(spannableString);
        styledText1.setSpan(new TextAppearanceSpan(mContext, style), index, index + 1,
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        textView.setText(styledText1, TextView.BufferType.SPANNABLE);
    }
}