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

  • SEARCH
  • Home
  • 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 7909205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:18:31+00:00 2026-06-03T12:18:31+00:00

If I want to have an ExpandableListView, which gets data from a response from

  • 0

If I want to have an ExpandableListView, which gets data from a response from server(JSON array) for its groups and their children.
How can I do it?
I know that there is SimpleCursorTreeAdapter, but it used only for cursor and I used it before, but I need any equivalent for this adapter to use it with JSON arrays

This is the function to get the groupItems

        protected void BindOrederItemList(final int order_id) 
    {
        // TODO Auto-generated method stub
        //select all categories from order items where order_id =??
        //select items where category=??
        String Url="http://192.168.3.113/mywebservices.php?op=GetOrderCategory&lang_id=1&order_id="+order_id;
        GetNetworkData.OnPostExecuteListener listener=new GetNetworkData.OnPostExecuteListener() 
        {

            @Override
            public void onPostExecute(String result) {
                // TODO Auto-generated method stub
                if (result!=null)
                {
                    try
                    {

                 JSONArray jArray = new JSONArray(result);
                 HashMap<String, String> Catmap = new HashMap<String, String>();
               //  ArrayList<Integer> category=new ArrayList<Integer>();
                 for (int i = 0; i < jArray.length(); i++) 

                    {

                        JSONObject e = jArray.getJSONObject(i);
                            id=e.getInt("order_id");

                         cat_name=e.getString("cat_name");
                          cat_id=e.getInt("cat_id");
                          Catmap.put("cat_id",String.valueOf(cat_id));
                          Catmap.put("cat_name", cat_name);
                          catItemsList.add(Catmap);

                    }
                Log.i("Insid For Loop", "Group size = "+catItemsList.toArray());



                      //  Log.i("Bind item", "CAT SIZE "+catItemsList.size());

                        }
                    catch(Exception e)
                    {
                        e.printStackTrace();
                    }
                }

            }

        };

        try
        {
        GetNetworkData task = new GetNetworkData(Url,null,listener);
        task.execute();
        }
        catch(Exception e)
        {

            e.printStackTrace();

        }
    }

Thanks

  • 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-03T12:18:32+00:00Added an answer on June 3, 2026 at 12:18 pm

    One way of doing it is using a SimpleExandableListAdapter.

    In that case you will have to first fetch and then store your JSON data as a List of Maps. That you could accomplish using an AsyncTaskLoader, in which you fetch and repackage the data, and then create a new instance of your adapter in the background, which you then swap into the ExandableListView.

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

Sidebar

Related Questions

I want have animation on hovering a which shall slide from top and on
want to have a Hyperlink-Button in a gridView in which I can display a
I want to have the ListItems to extend with their orange background the full
I have a ExpandableListView in which i am loading custom layouts in both group
If I have output from two sources that I want to put together on
I have set of Visual Studio solutions which have unit tests. I want to
I'm using ExpandableListView. i have a around 100 groups in the list, and 10-15
I am working with ExpandableListView in which I want to show following properties for
I want to have mixed https/http site. Moreover I want have redirects from https
I have an ExpandableListView that I want to populate with my custom views of

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.