Android HTML Decode fromHtml(String str)

Here you can find the source of fromHtml(String str)

Description

from Html

Declaration

public static Spanned fromHtml(String str) 

Method Source Code

//package com.java2s;

import android.text.Html;
import android.text.Spanned;

public class Main {

    public static Spanned fromHtml(String str) {
        if (!isEmpty(str)) {
            return Html.fromHtml(str);
        } else//w  w w  .j a v  a2s.  c om
            return Html.fromHtml("");
    }

    public static boolean isEmpty(String input) {
        if (input == null || "".equals(input))
            return true;

        for (int i = 0; i < input.length(); i++) {
            char c = input.charAt(i);
            if (c != ' ' && c != '\t' && c != '\r' && c != '\n') {
                return false;
            }
        }
        return true;
    }

    public static boolean equals(String str1, String str2) {
        return str1 == str2 || str1 != null && str1.equals(str2);
    }
}

Related

  1. htmldecode(String str)
  2. getHrefInnerHtml(String href)