【问题标题】:how to dispaly image in grid view reading imageUrl from xml using sax parser in android [duplicate]如何在android中使用sax解析器从xml读取图像Url在网格视图中显示图像[重复]
【发布时间】:2011-06-30 07:20:54
【问题描述】:

可能重复:
how to display image in grid view reading imageUrl from xml using sax parser in android

感谢您的回答,但我可以从 url 读取 xml 文件,但我需要是否在 xml imageUrl 中,所以在网格视图中显示..这是我的 xml 文件并读取 URL

<?xml version="1.0" encoding="UTF-8"?>
<channels>
    <channel>
        <name>ndtv</name>
<logo>http://a3.twimg.com/profile_images/670625317/aam-logo--twitter.png</logo>     
        <description>this is a news Channel</description>
        <rssfeed>ndtv.com</rssfeed>
    </channel>
    <channel>
        <name>star news</name>
<logo>http://a3.twimg.com/profile_images/740897825/AndroidCast-350_normal.png</logo>        
        <description>this is a newsChannel</description>
        <rssfeed>starnews.com</rssfeed>
    </channel>
</channels>

【问题讨论】:

  • 我真的不明白你的问题。
  • 这是我的 Xml 文件存储某个地方,我想读取此 xml 文件并使用 SAX 解析器在 gridview 中显示 imageurl iamge。谢谢
  • @PramodKumar 你实现了在gridview 中显示xml 图像吗?

标签: android parsing sax


【解决方案1】:

有SAX解析教程here,HttpClient示例here,GridView教程here

您需要解析 XML,将 URL 存储在列表中,使用 HttpClient 检索这些 URL,将图像加载到 Bitmap 对象中,并在 AdaptergetView() 方法中使用imageView.setImageBitmap().

抱歉,答案非常笼统,但这是一个非常笼统的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多