2
내가 노력자바 JSONArray 및 동적 키
{
"id":[email protected]",
"contact":[
{
"uid":0,
"name":"johnsmith",
"email":[
{
"home":"[email protected]"
},
{
"work":"[email protected]"
}
],
"mobile":[
{
"cc":"+60",
"mobile":"00000000"
},
{
"cc":"+60",
"mobile":"00000001"
}
]
}
]
}
이메일 동적 키를 사용하여이 형식의 JSON을
Iterator it = contactArray.getJSONObject(i)
.getJSONObject("email").keys();
하지만 난 오류
org.json.JSONException: JSONObject["email"] is not a JSONObject.
받고 있어요
하지만이 방법이 효과적이지만 JSONArray에서 키를 가져 오는 방법은 없습니다.
JSONArray emailArray = contactArray.getJSONObject(i)
.getJSONArray("email");
동적 키를 처리하는 방법은 무엇입니까? 감사.