gpt4 book ai didi

Android:JSONArray 解析问题

转载 作者:行者123 更新时间:2023-11-29 20:13:39 26 4
gpt4 key购买 nike

我是 android 的新手,在 Json 解析中遇到了一些问题。

JSONArray resultJsonArray = data.getJSONArray("detailsArr");

getJSONArray 显示为红色,表示 getJSONArray 存在问题。但我无法解决它。

JSON:

{"msg":"","status":true,"result":[{"conversation":"<p>sani<\/p>","attachmentName":"","attachmentURL":"","clientType":"student","repliedOn":"30-Sep-15 11:19AM","expertName":"shubham goyal","expertPic":""},{"conversation":"<p>rere<\/p>","attachmentName":"","attachmentURL":"","clientType":"expert","repliedOn":"1-Oct-15 5:31PM","expertName":"shubham goyal","expertPic":""},{"conversation":"<p>all vl<\/p>","attachmentName":"","attachmentURL":"","clientType":"student","repliedOn":"1-Oct-15 5:44PM","expertName":"shubham goyal","expertPic":""},{"conversation":"<p>asa kk<\/p>","attachmentName":"","attachmentURL":"","clientType":"expert","repliedOn":"1-Oct-15 5:45PM","expertName":"shubham goyal","expertPic":""}]}

最佳答案

根据你的JSON

应该是

 JSONArray resultJsonArray = data.getJSONArray("result");

因为结果是数组的名称。

关于Android:JSONArray 解析问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34397172/

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