我收到错误 org.json.JSONException: No value for PROJECT_NAME This is my json
{"PROJECTS":[
{
"PROJECT_NUMBER": "2062",
"PROJECT_NAME": "OPW 51183"
},
{
"PROJECT_NUMBER": "404",
"PROJECT_NAME": "404"
},
{
"PROJECT_NUMBER": "2125",
"PROJECT_NAME": "OPW 50016"
},
{
"PROJECT_NUMBER": ""
},
{
"PROJECT_NUMBER": "2130",
"PROJECT_NAME": "OPW 51151 63rd & Shirley SEW S"
},
{
"PROJECT_NUMBER": "2159",
"PROJECT_NAME": "OPW 51226"
}
]
}
和鳕鱼是:
for (int i = 0; i < innerProjectarray.length(); i++)
{
JSONObject obj=innerProjectarray.getJSONObject(i);
String projectnumber1=obj.getString("PROJECT_NUMBER");
String projectname1=obj.getString("PROJECT_NAME");
}
如果密钥不存在,是否有任何方法可以找到密钥,然后 np 需要获取特定字符串的值 帮助我,谢谢