[英]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.我正在制作一个 Android 应用程序,我正在使用 JRE 6 和最新的 jSoup 库。 I'm trying to parse a string containing HTML using the following method:我正在尝试使用以下方法解析包含 HTML 的字符串:
public static String html2text(String html) {
return Jsoup.parse(html).text();
}
I get the following exception:我得到以下异常:
java.lang.NoSuchMethodError java.lang.string.isEmpty 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?您使用哪个版本的 android sdk?
The isEmpty method has been introduced inversion 9 of android . isEmpty 方法已在android 版本 9 中引入。
A solution could be an upgrade to release 9 and above or a work around:解决方案可能是升级到版本 9 及更高版本或解决方法:
String a;
System.out.println( a.equals("") ):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.