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.
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
For you this may do the trick: