Skip to content
Advertisement

Android JSON parsing of multiple JSONObjects inside JSONObject

I have a JSON string coming from the server and it looks like this:

JavaScript

My task is to get values of the “term_id” and “name” fields. I’ve used to get the “categories” object from current JSONObject by using this code:

JavaScript

and the categoryObject looks like this:

JavaScript

But after that I don’t know how to get the fields. Is there any way to get all JSONObject children from the JSONObject?

If you have a source code or can give me an example please share it with me.

Advertisement

Answer

here you can retrieve all your json data, ask for a specific key and innerKey to get what you want, cheers

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement