Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7780325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:51:33+00:00 2026-06-01T18:51:33+00:00

I’m trying to create a simple RSS feed reader application for my mobile computing

  • 0

I’m trying to create a simple RSS feed reader application for my mobile computing class. I’ve created a class to manage and hold RSS data.

@SuppressWarnings("unchecked")
    SimpleExpandableListAdapter rssItemList = new SimpleExpandableListAdapter(
            this,                       // context (this class)
            createTitleList(),          // Creating group List
            R.layout.parent_row,        // Group item layout XML
            new String[]{"titles"},     // the key of group item
            new int[]{R.id.itemTitle},  // ID of each group item.-Data under the key goes into this TextView
            createChildList(),          // childData describes second-level entries
            R.layout.child_row,         // Layout for sub-level entries(second level)
            new String[]{"desc"},       // Keys in childData maps to display
            new int[]{R.id.itemDesc}    // Data under the keys above go into these TextViews
    );
    setListAdapter(rssItemList);

My problem is displaying it, I’m trying to use a ExpandableListView and I keep getting an error when I try to expand an item in the list.

E/AndroidRuntime( 2542): FATAL EXCEPTION: main
E/AndroidRuntime( 2542): java.lang.ClassCastException: java.util.HashMap
E/AndroidRuntime( 2542):        at android.widget.SimpleExpandableListAdapter.getChildrenCount(SimpleExpandableListAdapter.java:255)
E/AndroidRuntime( 2542):        at android.widget.ExpandableListConnector.refreshExpGroupMetadataList(ExpandableListConnector.java:561)
E/AndroidRuntime( 2542):        at android.widget.ExpandableListConnector.expandGroup(ExpandableListConnector.java:682)
E/AndroidRuntime( 2542):        at android.widget.ExpandableListView.handleItemClick(ExpandableListView.java:567)
E/AndroidRuntime( 2542):        at android.widget.ExpandableListView.performItemClick(ExpandableListView.java:527)
E/AndroidRuntime( 2542):        at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
E/AndroidRuntime( 2542):        at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 2542):        at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 2542):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2542):        at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 2542):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2542):        at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2542):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 2542):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 2542):        at dalvik.system.NativeStart.main(Native Method)

I don’t understand why I’m getting this error, since my code for making group and child List maps are nearly the same.

@SuppressWarnings({ "unchecked", "rawtypes" })
private List createTitleList(){
    ArrayList itemTitles = new ArrayList();
    ArrayList<ItemData> entriesList = (ArrayList<ItemData>) feed.getMessages();

    for(int i = 0; i < entriesList.size(); i++){
        HashMap m = new HashMap();

        m.put("titles", entriesList.get(i).getTitle());

        itemTitles.add(m);
    }

    return itemTitles;
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private List createChildList(){
    ArrayList itemDesc = new ArrayList(); // item description list
    ArrayList<ItemData> entriesList = (ArrayList<ItemData>) feed.getMessages();

    for(int i = 0; i < entriesList.size(); i++){
        HashMap<String, String> m = new HashMap<String, String>();

        m.put("desc", entriesList.get(i).getDescription());

        itemDesc.add(m);
    }

    return (List)itemDesc;
}

To be clear, it will display the group list, but won’t expand to show the child list.

For the benefit of future googlers, I’ve been using the following tutorials:

Expandable ListView In Android

Expandable lists

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:51:35+00:00Added an answer on June 1, 2026 at 6:51 pm

    Looking at the code for SimpleExpandableListAdapter (which I have never used, so I could be wrong here), the groups field is declared as

    List<? extends Map<String, ?>> 
    

    while the children should be

    List<? extends List<? extends Map<String, ?>>>
    

    Which is to say, the children should be a list of lists of maps, not a list of maps as you seem to be providing.

    I’d suggest getting rid of the lines where you suppress warnings about generic types, and actually fix the warnings rather than just hiding them. They do prevent this kind of failure, and there are very few situations where they are actually unavoidable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.