Count item in xml
<p>i'm getting an RSS feed like the following:</p>

<pre><code>        &lt;item&gt;
        &lt;caterory&gt;sports&lt;/category&gt;
        &lt;content:encoded&gt;text 1......&lt;/content:encoded&gt;
        &lt;title&gt;title 1...&lt;/title&gt;
        &lt;/item&gt;

        &lt;item&gt;
        &lt;caterory&gt;news&lt;/category&gt;
        &lt;content:encoded&gt;text 2......&lt;/content:encoded&gt;
        &lt;title&gt;title 2 ...&lt;/title&gt;
        &lt;/item&gt;

        &lt;item&gt;
        &lt;caterory&gt;sports&lt;/category&gt;
        &lt;content:encoded&gt;text 3......&lt;/content:encoded&gt;
        &lt;title&gt;title 3 ...&lt;/title&gt;
        &lt;/item&gt;

         ......

        &lt;item&gt;
        &lt;caterory&gt;news&lt;/category&gt;
        &lt;content:encoded&gt;text x......&lt;/content:encoded&gt;
        &lt;title&gt;title x ...&lt;/title&gt;
        &lt;/item&gt;
</code></pre>

<p>I would like to create a list ,and the listitems should be named as the category name.So,if the user click on sports,he could see the sports new, etc.
How easy is this to be done?
Searching the net i haven't found something similar.
As now, i have created a list witch returns me a list with all the categories (ex. if i have 25 articles, i get a list with 25 categories,sometime the same,as 1.sports,2.news,3.sports,...etc)</p>

<pre><code>int position=1;
if (feed.getItem(position).getCategory()!=null)
{


for(int pos=0;pos&lt;feed.getItemCount();pos++){

    //feed.getItemCount();

    SlideMenuItem item2=new SlideMenuItem();
    item2.id = MYITEMCATEGORY;
    item2.icon = getResources().getDrawable(R.drawable.favorite_full);
    item2.label = feed.getItem(pos).getCategory();
    slidemenu.addMenuItem(item2);
}
</code></pre>

<p>Sorry for my bad syntax,hope my question is understandable..:)</p>
