-1

I want to parse JSON which looks like this:

{
 "A": [
  [
    "content1"
  ],
  [
    "content2"
  ]
 ]
}

I need content1 and content2 as a String.

What I tried

String content = object.getString("A");

but with this I get a String which includes content1 and content2.
I need it seperated because I add it to GridView later.

This is not a duplicate of the question which is marked, look at the JSON it is different.

Hannes
  • 223
  • 1
  • 3
  • 9

1 Answers1

0

It should be object.getJSONArray("A"), store it in some variable.

JSONArray someArray = object.getJSONArray("A");

and than you can traverse through JSONArray to get its values

Ravi
  • 34,851
  • 21
  • 122
  • 183