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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:46:20+00:00 2026-05-25T17:46:20+00:00

in my app when i hit an url i am getting a return data

  • 0

in my app when i hit an url i am getting a return data as an json array. it is as follows

{"Status":[{ "img_path": "http://xxxxxxxxxxxxxx.com/images/thumb140/1316145577.jpg", 
             "img_path": "http://xxxxxxxxxxxxxx.com/images/thumb140/1316146270.jpg", 
             "img_path": "http://xxxxxxxxxxxxxx.com/images/thumb140/1316146473.jpg", 
             "img_path": "http://xxxxxxxxxxxxxx.com/images/thumb140/1316147003.jpg" } ]} 

From the above result i am trying to parse out the urls and i am trying to store it in an array list. Following is my code

 try{
        JSONArray get_post_status = json.getJSONArray("Status");
        for (int i = 0; i < get_post_status.length(); i++) {
        JSONObject e = get_post_status.getJSONObject(i);
        if(e.equals("img_path"))
        {
            Get_post_image_array.add(e.getString("img_path"));
        }
        }

But in my arraylist i am getting only the last url from the result. How to get all the urls in the arraylist.

Pls help me…….

  • 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-25T17:46:21+00:00Added an answer on May 25, 2026 at 5:46 pm

    The returned JSON is invalid.

    Shortening the data, looking only at the structure:

    {
        "Status":
            [
                {
                    "img_path": "a", 
                    "img_path": "b", 
                    "img_path": "c", 
                    "img_path": "d"
                }
            ]
    }
    

    We can see that the array (enclosed in []) only contains one element; the object enclosed by {}. This object has several instances of the same key, "img_path". This is not valid. Your parser apparently ends up with keeping only the last instance of it.

    The JSON ought to look more like this:

    {
        "Status":
            [
                "a", 
                "b", 
                "c", 
                "d"
            ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I built a project as descripted in this URL: http://msdn.microsoft.com/en-us/library/ms734784.aspx I used the app.config
I'm hit a problem when attempting to deploy a MVC app as a sub-application
This happens after I hit Build and Go to run my app on my
So I'm building a rails app for high school students and I've hit a
I'm currently writing a Rails app, and hit a somewhat strange quirk. I have
I'm writing an asp.net web app. and i've hit a bit of a brick
I have an asp.net update web app. Users go the the page, hit the
I am beginning to work on my first OpenGL iPhone app, but I've hit
I generally use will_paginate for the pagination in my app, but have hit a
App Engine only allows you to use these formats for XMPP addresses: app-id@appspot.com anything@app-id.appspotchat.com

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.