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.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;

public class Main {
    public static CharSequence convertStringToShowErrorInEditText(String string) {
        ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.WHITE);
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(string);
        spannableStringBuilder.setSpan(foregroundColorSpan, 0, string.length(), 0);
        return spannableStringBuilder;
    }
}