【问题标题】:get images from xml which contains path of images从包含图像路径的xml获取图像
【发布时间】:2011-07-20 06:38:06
【问题描述】:

我有一个包含图像路径的 XML 文件,如下代码:

<Source>
  <ID>001</ID>
  <Name>News</Name>
  <Country>United States</Country>
  <FeedURL>
    http://abcd.xml
  </FeedURL>
  <Download>true</Download>
  <Image>
    http://creativityinlife.files.wordpress.com/2009/03/as_much_as_i_dream.jpg
  </Image>
</Source>

我想检索并显示图像。有人可以帮忙吗?

【问题讨论】:

    标签: android xml


    【解决方案1】:

    由于您的 xml 非常简单,您可以使用 DOM 解析器,请参考 Android XML Parsing Tutorial – Using DOMParser 并获取该 url
    然后使用Load Image from server using thread 加载该网址

    【讨论】:

    • 我分别从 url 加载了 xml 文件和图像,但是如何从 xml id 加载图像。这个还是不太清楚。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-15
    • 1970-01-01
    • 2011-05-10
    • 1970-01-01
    • 1970-01-01
    • 2012-03-05
    相关资源
    最近更新 更多