How to read JSONArray inside a JSONΑArray

I have the following data in header response and I need to get the value of name.


I'm trying to get it using the following code

 JSONArray token_header = new JSONArray (response.getHeaders("token"));
 JSONObject objectElements = new JSONObject(token_header.getJSONObject(0));
 String Element = objectElements.getString("Element");

However, I got the error org.json.JSONException: JSONObject["Element"] not found.

Read more here:

Content Attribution

This content was originally published by zinon at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: