Java tutorial
//package com.java2s; import android.text.Html; import android.text.TextUtils; import android.widget.TextView; public class Main { public static void setValue(TextView v, String value) { String err_msg_which = ""; if (v != null) { if (TextUtils.isEmpty(value)) { err_msg_which = "Value"; value = ""; } v.setText(Html.fromHtml(value)); } else { err_msg_which = "TextView"; } } public static void setValue(TextView v, String value, String defaultValue) { String err_msg_which = ""; if (v != null) { if (TextUtils.isEmpty(value)) { err_msg_which = "Value"; value = defaultValue; } v.setText(Html.fromHtml(value)); } else { err_msg_which = "TextView"; } String err_msg_format = "%s is null"; // LogU.eLog(String.format(err_msg_format, err_msg_which)); } public static void setValue(TextView v, int resid) { String titls = v.getResources().getString(resid); v.setText(titls); } }