I have follows below xml feed:
<Categories>
<Category name="Title 1"
<Article>
<article title="subtitle 1" id="1" >
<thumb_image>
<image url="http://forfeed.jpeg"/></thumb_image>
<images>
<image url="http://ad_thumb.jpg"/>
</images>
</article>
<article title="subtitle 2" id="2" >
<image url="http://forfeed.jpeg"/></thumb_image>
<images>
<image url="http://ad_thumb.jpg"/>
</images>
</article>
</Article>
</Category>
<Category name="Title 2"
<Articles>
<article title="subtitle 4" id="4" >
<image url="http://forfeed.jpeg"/></thumb_image>
<images>
<image url="http://ad_thumb.jpg"/>
</images>
</article>
<article title="subtitle 5" id="5" >
<image url="http://forfeed.jpeg"/></thumb_image>
<images>
<image url="http://ad_thumb.jpg"/>
</images>
</article>
</Articles>
</Category>
This is my handler class:
public void startElement(String uri, String localName, String qName,Attributes attributes) throws SAXException {
currentElement = true;
if (localName.equals("Categories"))
{
sitesList = new SitesList();
}
------------------------
---------------------
---------------------
else if (localName.equals("thumb_image")) {
ImageList ImageList = new ImageList();
n++;
isThumbURL = true;
}
else if (localName.equals("image")) {
if (isThumbURL)
{
String attr = attributes.getValue("url");
sitesList.setImageURL(attr);
String Sub_arry=n+attr;
Appscontent.Sub_arraylist.add(Sub_arry);
}}}
In my main activity have to set the image :
im.setImageBitmap(Appscontent.Sub_arraylistimage);
In these line am getting following error:
The method setImageBitmap(Bitmap) in the type ImageView is not applicable for the arguments (ArrayList)
How can i resolve these error.please help me...
EDIT:
In my xml feed how can i get the image url from thumb_image tag alone...but in these code am getting the image url from both thumb_image and images tag..how can i write the condition for these...