如何获取网址< img src =''>一个RSS Feed并在android中打开
<description><img src="http://static.ibnlive.in.com/ibnlive/pix/sitepix/03_2010/Google_new_630_90x62.jpg" alt="REDIRECTED: Google shut its Chinese portal over censorship and visitors were being redirected to Hong Kong-based site." title="REDIRECTED: Google shut its Chinese portal over censorship and visitors were being redirected to Hong Kong-based site." border="0" wIDth="70" height="50" align="left" hspace="5"/>The company joins Google in protesting cyber attacks and censorship in China.</description>
解决方法:
如果您想从上面的XML获取URL,可以尝试使用jsoup库:
String input = "<description>\n" + "<img src=\"http://static.ibnlive.in.com/ibnlive/pix/sitepix/03_2010/Google_new_630_90x62.jpg\"" + " alt=\"REDIRECTED: Google shut its Chinese portal over censorship and visitors were being redirected" + " to Hong Kong-based site.\" Title=\"REDIRECTED: Google shut its Chinese portal" + " over censorship and visitors were being redirected to Hong Kong-based site.\"" + " border=\"0\" wIDth=\"70\" height=\"50\" align=\"left\" hspace=\"5\"/>The company" + " joins Google in protesting cyber attacks and censorship in China.\n" + "</description>";document document = Jsoup.parse(input);String output = document.select("img").first().attr("src");
总结 以上是内存溢出为你收集整理的android – 如何获取rss feed的xml解析全部内容,希望文章能够帮你解决android – 如何获取rss feed的xml解析所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)