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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:55:37+00:00 2026-06-16T10:55:37+00:00

use json jason parser but i am not adding multiple tag values into the

  • 0

use json jason parser but i am not adding multiple tag values into the arraylist and i want to parse $t tag with Actor into the arraylist.such as

{
"media$group":{
"media$credit":[
{
"$t":"Murison Dunn",
"role":"Writer",
"scheme":"urn:ebu"
},
{
"$t":"Randolph Scott",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Forrest Tucker",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"name":"Mala Powers",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"J. Carrol Naish",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Edgar Buchanan",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"name":"Myron Healey",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Howard Petrie",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"name":"Ray Teal",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"William Forrest",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Denver Pyle",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Trevor Bardette",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Kenneth Tobey",
"role":"Actor",
"scheme":"urn:ebu"
}
]
},

{
"media$group":{
"media$credit":[
{
"$t":"Murison",
"role":"Writer",
"scheme":"urn:ebu"
},
{
"$t":"Scott",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Tucker",
"role":"Actor",
"scheme":"urn:ebu"
}
{
"name":"Powers",
"role":"Actor",
"scheme":"urn:ebu"
}
]
},

{
"media$group":{
"media$credit":[
{
"$t":"Dunn",
"role":"Writer",
"scheme":"urn:ebu"
},
{
"$t":"J.Naish",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Buchanan",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Healey",
"role":"Actor",
"scheme":"urn:ebu"
},
{
"$t":"Petrie",
"role":"Actor",
"scheme":"urn:ebu"
}
]
}
}

However my main issue is that I need to get multiple items from $t tag into the arraylist. and my code is:

JSONObject jsonmediagrop=videoObject.getJSONObject("media$group");
 JSONArray itemsmediarole = jsonmediagrop.getJSONArray("media$credit");
            for(int l=0;l<itemsmediarole.length();l++){
                JSONObject Objectrole = itemsmediarole.getJSONObject(l);

                strrole=Objectrole.getString("Role");
                Log.v("Role", strrole);

                if(strrole.equals("Actor"))
                { 

                     stractor=Objectrole.getString("$t") + "," + stractor;
                     Log.v("stractor", stractor);
                     maprole.put("$t", stractor);
                     myrolelist.add(maprole);
                }

            }

myrolelist -this is the arraylist. maprole-this is the hashmap.
Any help is appreciated.

  • 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-16T10:55:38+00:00Added an answer on June 16, 2026 at 10:55 am

    Okay after reading your comment in the other answer, I decided to help you.
    I had lots of problems parsing mine too. Went through lots of researches
    In my code I was trying to get the rstp url links.
    I hope you can look at it and solve your problem.
    This is my working code

        try {
            JSONObject obj = new JSONObject(json);
            String entry = obj.getString("entry");
            JSONObject enObj = new JSONObject(entry);
            String group = enObj.getString("media$group");
            JSONObject grObj = new JSONObject(group);
            String content = grObj.getString("media$content");
            JSONArray array = grObj.getJSONArray("media$content");
            for(int j=0; j<array.length(); j++){
                JSONObject thumbs = array.getJSONObject(j);
                String url = thumbs.getString("url");
                urls[j] = url;
                Log.d(TAG, url);
                //data.setThumbUrl(thumbUrl);
            }
    
    
            Log.v(TAG, content);
        } catch (Exception e) {
            Log.e(TAG, e.toString());
        }
    

    For you this may do the trick:

       try {
            JSONObject obj = new JSONObject(json);
            String entry = obj.getString("entry");
            JSONObject enObj = new JSONObject(entry);
            String group = enObj.getString("media$group");
            JSONObject grObj = new JSONObject(group);
            JSONArray array = grObj.getJSONArray("media$credit");
            for(int j=0; j<array.length(); j++){
                JSONObject credits = array.getJSONObject(j);
                String role = credits.getString("role");
                Log.d(TAG, role);
            }
    
        } catch (Exception e) {
            Log.e(TAG, e.toString());
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Gson to parse my JSON, I've added Gson library into
Specific situation: I want a package providing a JSON Parser for Android (not self-written,
I use JSON.NET and I would like to parse the following object which I
I struggle to use a jquery selector containing brakcets. Basically I parse a JSON
http://pastebin.com/rXbeKqAa Hi all I have been trying to parse the above JSON into a
When I use JSON.parse(jsonString), the JSON is parsed no problem at all. var result
I am trying to dynamically map JSON information into different objects. But I can't
I am using JSON.parse to turn a JSON string into a JSON object. It
I am trying to parse JSON from a server, however whenever I use AFNetworking
I was added jackson-mini-1.9.2.jar(is not jackson-all-1.9.2.jar) in my project, I want to convert json

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.