I have following JSON as response from my server. At first, I thought, it was invalid JSON but after validating it, it seems to be correct:
JOSN: {
\"cat
Try out this code
JSONObject obj = result.getJSONObject("category");
Iterator keys = obj.keys();
while (keys.hasNext()) {
// loop to get the dynamic key
String dynamicKey = (String) keys.next();
String value= obj.getString(dynamicKey);
}
For more information checkout this link. May be this will help you more.