2011-06-30 123 views
-2

可能重复,以dispaly从XML网格视图阅读IMAGEURL图像:
how to display image in grid view reading imageUrl from xml using sax parser in android如何使用SAX解析器的Android

感谢的答案,但我能够读取URL的XML文件但我需要如果XML IMAGEURL有这么显示网格视图..this是我的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> 
+0

我真的不明白你的问题。 –

+0

这是我的Xml文件存储一些地方,我想读这个XML文件,并使用SAX解析器在gridview中显示imageurl iamge。谢谢 –

+0

@PramodKumar是否实现了在gridview中显示xml图像? – AndroidOptimist

回答

0

有关于SAX解析here的教程,HttpClient here的示例,以及有关GridView here的教程。

你需要分析你的XML,存储你的URL列表中,使用的HttpClient检索这些网址,在对位图对象加载图像,并在您使用imageView.setImageBitmap()AdaptergetView()方法设置您的ImageView的对象。

很抱歉给出非常广泛的答案,但这是一个非常广泛的问题。