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("") ):
精彩评论