开发者

Error when parsing string of HTML with Jsoup

开发者 https://www.devze.com 2023-03-12 10:15 出处:网络
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:

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

精彩评论

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