Here you can find the source of setHtml(TextView view, String html)
public static void setHtml(TextView view, String html)
//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))); }//from w w w.j a v a 2 s .com 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; } }