gpt4 book ai didi

android - JSON:如何处理这样的 JSON 响应?

转载 作者:行者123 更新时间:2023-11-30 04:31:42 25 4
gpt4 key购买 nike

这是回应我想知道如何处理这样的 JSON 响应?这是一个 JSONArray,但没有名称这是响应:

[[84,"sinat","qq357068756@163.com"],[88,"msn","qq357068756@hotmail.com"],[89,"163t","qq357068756@hotmail.com"],[90,"mail","qq357068756@hotmail.com"],[93,"mail","qq357068756@163.com"]]

最佳答案

数据不是 JSONObject 而是 JSONArray !

String json_value = '[[84,"sinat","qq357068756@163.com"],[88,"msn","qq357068756@hotmail.com"],[89,"163t","qq357068756@hotmail.com"],[90,"mail","qq357068756@hotmail.com"],[93,"mail","qq357068756@163.com"]]';

JSONArray json_array = new JSONArray(json_value);

像这样走过它

for(int i = 0; i < json_array.length(); i++){
Log.d("Current index: "+i,"Current value: "+json_array.getJSONArray(i).toString());
}

关于android - JSON:如何处理这样的 JSON 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7610282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com