gpt4 book ai didi

android - 在改造android中解析嵌套的json对象

转载 作者:行者123 更新时间:2023-11-29 18:56:51 25 4
gpt4 key购买 nike

我无法在改造中解析 json,这是我的示例 json,键是动态的,这样的 json 数据需要什么 POJO 定义:

    {
"Fri Mar 23 2018 17:35:36 GMT+0530 (IST)": {
"PDF": "",
"URL": "",
"image": "",
"shortDescription": "test one",
"timestamp": "2018-03-23T12:05:36.319Z",
"title": "test "
},
"Fri Mar 23 2018 17:44:43 GMT+0530 (IST)": {
"PDF": "",
"URL": "",
"image": "",
"shortDescription": "two test",
"timestamp": "2018-03-23T12:14:43.194Z",
"title": "two"
},
"Fri Mar 23 2018 17:49:06 GMT+0530 (IST)": {
"PDF": "",
"URL": "https://twitter.com/CodingDoug/status/942576182276497409",
"image": "https://drive.google.com/open?id=1gBUaAVdAttmAqv68OChHCDqlbKAoxZW6",
"shortDescription": "test three",
"timestamp": "2018-03-23T12:19:06.835Z",
"title": "three"
},
"Mon Mar 26 2018 15:56:06 GMT+0530 (IST)": {
"PDF": "",
"URL": "https://www.goodmorningquote.com/inspirational-monday-quotes-start-happy/",
"image": "https://drive.google.com/open?id=1fg1z0_jzTUUiXhvkHyGLewJC2LFFzEyW",
"shortDescription": "1st day of week, great day to plan and jumpstart week ",
"timestamp": "2018-03-26T10:26:06.983Z",
"title": "Monday test 1 "
}
}

最佳答案

尝试 Map<String, Object>解析json。字符串是这里的变量键。对象是您的“PDF”、“URL”的 POJO, “图像”, “简短的介绍”, “时间戳”, "title": "测试"

关于android - 在改造android中解析嵌套的json对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49809760/

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