Sebastian Sebastian - 1 month ago 10
JSON Question

Responce data as json array in Android

I am sending a

JSON
data to server and the server returning a data as
JSON
. How can I save the returning data as
JSONArray
? The returning value is in 'responce' variable, How can I save this response as
JSONArray
. I need to use the returning
JSONArray
to update my db.

This is my
JSON
,

[{
"_id": "1",
"name": "Sss",
"dob": "10/1/2000",
"gender": "Male",
"mobile": "123456780",
"address": "asdas"
}]

Answer
JSONArray jsonArray = new JSONArray();
jsonArray.put(responce); //don't blame for typo of responce