{
item:[
{
item_id: 1
add_on:[
{
name: Thin Crust
},
{
name: Extra Cheese
},
{
name: Extra Sauce
}
}]
}
I want to get these names and place them into one TextView
2
Answers
First of all include the
JSON
Library in your project.Then access your JSON Object like this:
First of all you need to correct to JSON input. It’s not valid JSON. Correct JSON should be :
After that with Jackon library you can get the data from Json in POJO as below:
POJO(s):
Conversion with Jackson:
Now from this object structure you can get names.