开发者

Error when parsing string of HTML with Jsoup

I'm making an Android app and I'm using JRE 6 and the latest jSoup library. I'm trying to parse a string containing HTML using the following method:

public static String html2text(String html) 开发者_StackOverflow{
    return Jsoup.parse(html).text();
}

I get the following exception:

java.lang.NoSuchMethodError java.lang.string.isEmpty

How can I rectify this?


Sorry, I made a mistake :

which version of android sdk do you use ?

The isEmpty method has been introduced in version 9 of android.

A solution could be an upgrade to release 9 and above or a work around :

String a;
System.out.println( a.equals("") ):
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜