Here you can find the source of setHtml(Activity activity, View parent, int elementId, int resId)
public static void setHtml(Activity activity, View parent, int elementId, int resId)
//package com.java2s; import android.app.Activity; import android.text.Html; import android.view.View; import android.widget.TextView; public class Main { public static void setHtml(Activity activity, View parent, int elementId, int resId) { TextView view = (TextView) parent.findViewById(elementId); view.setText(Html.fromHtml(activity.getString(resId))); }// ww w . j a va 2 s .c om public static void setHtml(TextView view, String html) { view.setVisibility(View.GONE); if (html != null && html.length() != 0) { view.setText(Html.fromHtml(html)); view.setVisibility(View.VISIBLE); } } public static void setText(TextView view, String text) { if (isEmpty(text)) { view.setVisibility(View.GONE); return; } view.setText(text); view.setVisibility(View.VISIBLE); } public static boolean isEmpty(String s) { return (s == null || s.length() == 0); } public static boolean isEmpty(CharSequence cs) { return cs == null || cs.length() == 0; } }