gpt4 book ai didi

android - 如何在android中解析这个JSON数组

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:17:47 27 4
gpt4 key购买 nike

我想要每个 TAG 的名称、电子邮件和图像。我必须在列表元素中显示。

{
"response":[
{
"name":"Brajendra Mishra",
"email":"test1@seologistics.com",
"address":"Information Service\r\nParliament of Canada\r\nOttawa, Ontario K1A 0A9",
"aboutus":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ",
"image":"http:\/\/74.52.209.213\/lab\/event\/img\/attachments\/photos\/small\/4f2a5a71-acc0-4319-b1ca-14774a34d1d5.jpg"
},
{
"name":"Toney Grey",
"email":"test2@seologistics.com",
"address":"Information Service\r\nParliament of Canada\r\nOttawa, Ontario K1A 0A9",
"aboutus":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ",
"image":"http:\/\/74.52.209.213\/lab\/event\/img\/attachments\/photos\/small\/4f1d4283-5204-4f16-90d6-69924a34d1d5.jpg"
}
],
"count":2
}

我尝试了很多,但还是做不到。

让我知道循环,如何达到每个名称、电子邮件、图像等的值,如何保持。

最佳答案

我为您的问题生成解决方案。

JSONArray jObject = new JSONArray(jsoninputstring);
for (int i = 0; i < jObject.length(); i++,start++) {
JSONObject menuObject = jObject.getJSONObject(i);

String name= menuObject.getString("name");
String email= menuObject.getString("email");
String image= menuObject.getString("image");
}

关于android - 如何在android中解析这个JSON数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9529558/

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