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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:55:55+00:00 2026-06-07T22:55:55+00:00

Following is the json data which i am getting from an api { list:

  • 0

Following is the json data which i am getting from an api

{
     "list": {
        "items": [
            "About Us",
            "Services",
            "Working With",
            "Officehours",
            "Useful Links",
            "Terms & Conditions",
            "Go to Website"
        ]
    },
    "data": 
    {
        "about us": {  "description": " Aaaaaaaa"   },
        "services": {  "description": " Baaaaaaa."  },
        "working with": { "description": "Caaaaaa"  },
        "officehours": {   "title": "Office Hours:","timing": "09:00am - 06:00pm"},
        "useful links": {  "description": [ 
                 {
                    "name": "One",
                    "link": "http://www.google.com/"
                },
                {
                    "name": "Two",
                    "link": "http://www.yahoo.com"
                }]},
        "terms & conditions": { "description": "Daaaaaaaaa" },
        "go to website": { "link": "http: //www.amazon.com/"  },
    }
}

In the above json data the “list” values in the json array are to be show in a listview. I have added them in an array list and shown in a list view too.

Now when the user clicks on the list view the data corresponding to them are shown in the next activity. For example if the user clicks on the About US text of listview then i how to show the description Aaaaaaa in the next activity.

Like this for each item in list view i have to open different activity.
If the inner tag is description i have to open activity1
If the inner tag is title i have to open activity2
If the inner tag is link i have to open activity3
If the inner tag is description is to be an JSON array type, have to open activity4

I am not supposed to hot code the tags such as "about us", "services","working with","officehours","useful links","terms & conditions", "go to website" within the code.

In my OnItemClickListener i am doing the following

try
  {
     JSONObject locarray = new JSONObject(Appconstant.dataObj.get(0).toString());        
     String txt_data = locarray.getJSONObject(about.get(arg2).toLowerCase()).getString("description");
  }
  catch(Exception e)
  {
      Log.e("Exception @ json 1",""+e);
  }

in some cases i am getting an exception saying that there is no JSOn value of “description”

how to get this to be done, 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-06-07T22:55:57+00:00Added an answer on June 7, 2026 at 10:55 pm

    one way of doing it is by

    JSONObject jobj = new JSONObject(content); // the content you have above
    JSONObject data = jobj.getJSONObject("data");
    JSONObject aboutUs = data.getJSONObject("about us");
    String desc = aboutUs.getString("description:);
    

    not sure if this might help 🙂 if there is a case were the description is blank use

    aboutUs.optString("description");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reasons this part where I fetch JSON data from following url will
I have following json data which I want to pass it to server using
I am using jquery-tmpl and receiving the following JSON data, which I am using
I have a data Store that gets it's information from a JSON api on
I'm getting the following (str) back from Disqus, JSON expected: ?({code: 0, response: {username:
I am using following code for other JSON data its working but here it
Given the following JSON data: [ { pk: 2, model: corkboard.announcement, fields: { body:
I have the following JSON data being returned, but for some reason, Javascript or
I am trying to create a mapping for the following JSON data. { Calls:
I'm trying handle bad json data when parsed through json_decode(). I'm using the following

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.