【发布时间】:2016-08-04 13:43:46
【问题描述】:
大家好,我需要你们的帮助来从 json 对象中读取 随机命名 数组。
在这个任务中,客户根据自己的要求制作json对象。
喜欢
{
"tags":[ "demo 1","demo 2","demo 3","demo 4","demo 5","N" ]
}
我使用 "N" 来定义一个数组中的无限数量的项目。
在此代码中,用户使用 tags 键将 json Array 放入 json 对象中。
用户也可以将强调文本数组设为客户端
{
"Clients":[ "demo 1","demo 2","demo 3","demo 4","demo 5","N" ]
}
我知道怎么解析
JSONArray jsonMainArr = new JSONArray(String.valueOf(ObjectName.getJSONArray("Keyname")));
现在我的问题是如果我们不知道 KeyName 如 tags 或 Clients
,如何获取 Json 数组【问题讨论】:
-
试试@himanshu 的回答。对你有帮助。