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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:54:52+00:00 2026-05-30T04:54:52+00:00

I got the Json response. I am not able to get the values from

  • 0

I got the Json response. I am not able to get the values from the string.my string is

Json_response is

{"NameAllList":[{"Current":{"time":"2012-02-21T08:04:21","Name":"abcd"},
    "Next":{"Name":"data1","StartTime":"2012-02-21T08:06:21"}},{"Current":{"time":"2012-02-21T08:14:21","Name":"defg"},
    "Next":{"Name":"data2","StartTime":"2012-02-21T08:24:21"}},{"Current":{"time":"2012-02-21T08:28:21","Name":"ghij"},
    "Next":{"Name":"data3","StartTime":"2012-02-21T08:34:21"}},{"Current":{"time":"2012-02-21T08:40:21","Name":"knmo"},
    "Next":{"Name":"data4","StartTime":"2012-02-21T08:48:21"}}]}

and i tried this.

JSONObject jsonObj = new JSONObject(json_response);
JSONObject subObj = jsonObj.getJSONObject("Current");
String name_current =subObj.getString("Name");

but i am not able to get the value of “Name”. what mistake i have done. provide the link to do the above parsing.

  • 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-30T04:54:54+00:00Added an answer on May 30, 2026 at 4:54 am

    You are not parsing json properly, so you are not able to fetch value of Name. Please note JSON Annotation [] represent JSONArray, and {} respresent JSONObject, so method to get current item’s name is:

    JSONObject jsonObj = new JSONObject(json_response_string);
    JSONArray jsonArr=jsonObj.getJSONArray("NameAllList");
    String Hora_name_current="";
    for(int i=0;i<jsonArr.length();i++)
    {
         JSONObject obj=jsonArr.get(i);
         try{
               JSONObject subObj = obj.getJSONObject("Current");
               Hora_name_current =subObj.getString("Name");
               break;
         }catch(JSONException ex)
         {
    
         }
    
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read about JSON from internet but still i have not got the grasp
I've been trying to get a json response from google's geocoding service. I'm using
I've got the following object: $json = '{response: {status: {message: Success}, images: [{url: http://domain.com/images/0001.jpg},
The Google App Engine server is returning a JSON String in response to a
I've got the content from a HttpClient, but I'm not sure where to go
I've got a JSON response in the format of.. {item:{cid:544,id:3023,name:names},success:1,msg:} The response is stored
I've got a simple ASP.NET webservice. I'm wanting to return a string of json
I've got an AJAX request that expects JSON in response. But there's a possibility
I am trying to get send json from my javascript (using jquery post) to
I'm having problems adding subviews to a scrollview sequentially. I've got a JSON response

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.