在Android

时间:2016-11-04 06:52:31

标签: android json

我向服务器发送JSON数据,服务器返回JSON数据。如何将返回的数据保存为JSONArray?返回值在'responce'变量中,如何将此响应保存为JSONArray。我需要使用返回的JSONArray来更新我的数据库。

这是我的JSON

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

1 个答案:

答案 0 :(得分:1)

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