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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:20:37+00:00 2026-05-26T08:20:37+00:00

I need to parse a 2D array in Android and passing them as intent

  • 0

I need to parse a 2D array in Android and passing them as intent in another activity. How do I do that?

I am getting the following 2D array as a response from the server.

[
{
    "sno": "131",
    "email": "ruma.riwaz@gmail.com",
    "place": "43",
    "description": "",
    "image": "",
    "time": "1316156532"
},
{
    "sno": "130",
    "email": "ruma.riwaz@gmail.com",
    "place": "38",
    "description": "",
    "image": "",
    "time": "1316153291"
},
{
    "sno": "365",
    "email": "ruma.riwaz@gmail.com",
    "place": "86",
    "description": "",
    "image": "",
    "time": "1318427821"
},
{
    "sno": "129",
    "email": "ruma.riwaz@gmail.com",
    "place": "39",
    "description": "",
    "image": "",
    "time": "1316152314"
},
{
    "sno": "371",
    "email": "ruma.riwaz@gmail.com",
    "place": "90",
    "description": "",
    "image": "",
    "time": "1318502879"
},
{
    "sno": "370",
    "email": "ruma.riwaz@gmail.com",
    "place": "89",
    "description": "",
    "image": "",
    "time": "1318495237"
},
{
    "sno": "366",
    "email": "ruma.riwaz@gmail.com",
    "place": "86",
    "description": "",
    "image": "",
    "time": "1318427852"
},
{
    "sno": "126",
    "email": "ruma.riwaz@gmail.com",
    "place": "43",
    "description": "",
    "image": "",
    "time": "1316149489"
},
{
    "sno": "125",
    "email": "ruma.riwaz@gmail.com",
    "place": "43",
    "description": "",
    "image": "",
    "time": "1316148422"
},
{
    "sno": "168",
    "email": "ruma.riwaz@gmail.com",
    "place": "39",
    "description": "",
    "image": "",
    "time": "1316265504"
},
{
    "sno": "368",
    "email": "ruma.riwaz@gmail.com",
    "place": "87",
    "description": "",
    "image": "",
    "time": "1318480496"
},
{
    "sno": "174",
    "email": "ruma.riwaz@gmail.com",
    "place": "39",
    "description": "",
    "image": "",
    "time": "1316667799"
},
{
    "sno": "176",
    "email": "ruma.riwaz@gmail.com",
    "place": "39",
    "description": "",
    "image": "",
    "time": "1316670052"
},
{
    "sno": "252",
    "email": "ruma.riwaz@gmail.com",
    "place": "54",
    "description": "",
    "image": "",
    "time": "1317471220"
},
{
    "sno": "300",
    "email": "ruma.riwaz@gmail.com",
    "place": "39",
    "description": "",
    "image": "",
    "time": "1317964945"
},
{
    "sno": "299",
    "email": "ruma.riwaz@gmail.com",
    "place": "39",
    "description": "",
    "image": "",
    "time": "1317964703"
},

How do I fix this problem?

  • 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-05-26T08:20:38+00:00Added an answer on May 26, 2026 at 8:20 am

    FYI, myObject is the class that I have taken just for the reference and just defined getter and setter methods for all the above attributes inside this myObject class. And now when you are done with it, implement the below code to prepare an arraylist of all the items that your JSON contains.

          ArrayList<myObject> listObject = new ArrayList<myObject>();
          myObject obj = null;
    
          try {
            JSONArray jArray = new JSONArray(str);
            for(int i = 0; i < jArray.length() ; i++)
            {
                JSONObject jObject = jArray.getJSONObject(i);
                obj = new myObject();
                obj.setSno(jObject.getString("sno"));
                obj.setEmail(jObject.getString("email"));
                obj.setPlace(jObject.getString("place"));
                obj.setDescription(jObject.getString("description"));
                obj.setImage(jObject.getString("image"));
                obj.setTime(jObject.getString("time"));
    
             /* Add the list item object to the ArrayList. At the end you will be
                having an arraylist of all items that you have parsed. */
    
                listObject.add(obj);
            }
        }
        catch (JSONException e2) {
            // TODO Auto-generated catch block
            e2.printStackTrace();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting some response from server side which i need to parse but
I need to parse out the string that has following structure x:{a,b,c,}, y:{d,e,f} etc.
I have a long string that I need to parse into an array of
I need to be able to have boost::program_options parse an array of doubles that
Seems to be that I need to parse PDU byte array received during SMS
I have a rather big number of source files that I need parse and
Need to parse a file for lines of data that start with this pattern
I need to parse a log in the following format: ===== Item 5483/14800 =====
I need to parse a JSON response regarding events in an agenda, of which
I need to split long string into a array with following constrains: The input

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.