Java tutorial
//package com.java2s; import android.content.Context; import android.text.Html; import android.widget.EditText; public class Main { public static void setError(Context context, EditText editText, int messageId) { editText.setError(Html.fromHtml("<font color='red'>" + context.getString(messageId) + "</font>")); } }