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 8279729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:25:17+00:00 2026-06-08T09:25:17+00:00

Can someone help guide me on how to parse JSONArray’s into TextViews? So far,

  • 0

Can someone help guide me on how to parse JSONArray’s into TextViews? So far, everytime I parse it, It only shows me the last results, instead of everything.

So far I have:

            try {
            standby_position = json.getString("standby_position");
            zone_name = json.getString("zone_name");
            zone_no = json.getString("zone_no");
            status = json.getString("status");


            JSONArray standby_list = json.getJSONArray("standby_list");

            for (int i1 = 0; i1 < standby_list.length(); i1++) {
                JSONObject c = standby_list.getJSONObject(i1);


            DRIVER = c.getString(driver);
            SINCE = c.getString(since);
            WAITING = c.getString(waiting);
            GPS_DATA = c.getString(gps_data);



            }

        } catch (JSONException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

I was trying to to do:

 TextView information = (TextView) findViewById(R.id.information);
  information.setText ( DRIVER + SINCE + WAITING ); 

Here is what I am trying to parse:

 {
"driver": "819",
"gps_data": "1",
"last_geocode": "",
"lastLatitudeUpdate": "12/31/1969 5:00:00 PM",
"standby_position": "1",
"zone_name": "STK",
"zone_no": "STK",
"status": "Your are checked-in and currently #1 STK. (as of: 7/19/2012 1:50:02 PM)",
"standby_list": [
    {
        "driver": "291",
        "since": "12:33:00 PM",
        "waiting": "77",
        "gps_data": "0"
    },
    {
        "driver": "103",
        "since": "12:49:21 PM",
        "waiting": "61",
        "gps_data": "0"
    },
    {
        "driver": "287",
        "since": "12:51:00 PM",
        "waiting": "59",
        "gps_data": "0"
    },
    {
        "driver": "271",
        "since": "1:22:00 PM",
        "waiting": "28",
        "gps_data": "0"
    },
    {
        "driver": "819",
        "since": "8:58:36 AM",
        "waiting": "292",
        "gps_data": "1"
    }
]
 }

When I do this, the only last parse Json will show. Any ideas?

  • 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-08T09:25:20+00:00Added an answer on June 8, 2026 at 9:25 am

    What do you mean by last JSON?

    Are you referring to the last object in the JSONArray called “standby_list”?

    If so, that’s because you are only keeping a handle on the last one.
    Instead you should use some sort of collection and be calling Add on that.

    For example

    class MyObject {
        public String driver, since, waiting, gps;
    }
    
    List<MyObject> list = new ArrayList<MyObject>();
    
    for (int i1 = 0; i1 < standby_list.length(); i1++) {
        JSONObject c = standby_list.getJSONObject(i1);
        MyObject myContainer = new MyObject();   
    
        myContainer.driver = c.getString(driver);
        myContainer.since = c.getString(since);
        myContainer.waiting = c.getString(waiting);
        myContainer.gps = c.getString(gps_data);
        list.add(myContainer);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone help me, how can i define the keyCode ,which, charcode into variable.
using this as a guide: http://msdn.microsoft.com/en-us/library/dd250846.aspx can someone help me with the jquery call?
Can someone show/point/help me to a resource for distributed development Git example or guide?
Hope someone can help me. I have used the following tutorial as a guide
Can someone help me achieve multiple zend pagination in a view using ajax. I
Can someone help by showing me how to sort a LINQ expression. I have
Can someone help me understand how to write this case statement properly its not
Can someone help me with creating functions for the following processes? I want to
Can someone help me find the error when I tried to display the list
can someone help to write a method that converts a byte array to a

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.