Reputation: 5747
My JSONObject:
JSONObject callback = {"message": "message here", "response": "response here"}
I want get the response here from json's respone string. I've tried the following:
JSONObject response = callback.getJSONObject("response");
String message = next.getString("response");
I get the errot like String and JSONObjet conversion problems.
Upvotes: 0
Views: 61
Reputation: 23638
Try out as below:
JSONObject callback = {"message": "message here", "response": "response here"}
String response = callback.getString("response");
String message = callback.getString("message");
Upvotes: 1
Reputation: 1812
JSONObject callback = {"message": "message here", "response": "response here"}
you need to access response value like below code
String response = callback.getString("response");
Upvotes: 1