如果我的JSON對象看起來是這樣的:如何在Android中使用java訪問嵌套的JSON數據?
{
"weather:{
"sunny": "yes"
"wind": "48mph"
"location":{
"city": "new york"
"zip": "12345"
}
}
"rating": "four stars"
}
我將如何訪問這個城市叫什麼名字?我可以使用optString來獲取所有「天氣」或「評級」,但是如何獲取其中的信息?
http://developer.android.com/reference/org/json/JSONObject.html – Robert
@Robert感謝羅伯特我加了鏈接 – meda