Back to project page android-gskbyte-utils.
The source code is released under:
GNU Lesser General Public License
If you think the Android project android-gskbyte-utils listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.gskbyte.view; //from w w w. j a v a 2s .c o m import android.content.res.TypedArray; import android.text.Html; import android.util.AttributeSet; import android.widget.TextView; public class TextViewUtil { static public void setHtmlTextFromAttributes(TextView textView, AttributeSet attrs, int [] attributeSet, int fontAttr) { TypedArray a = textView.getContext().obtainStyledAttributes(attrs, attributeSet); String htmlText = a.getString(fontAttr); if(htmlText != null) setHtmlText(textView, htmlText); a.recycle(); } static public void setHtmlText(TextView textView, String html) { textView.setText( Html.fromHtml(html) ); } }