{"location":{
"name":"New York","region":"New York","country":"United States of America","lat":40.71,"lon":-74.01,"tz_id":"America/New_York","localtime_epoch":1488124171,"localtime":"2017-02-26 10:49"},
"forecast":{
"forecastday":[{"date":"2017-02-26","date_epoch":1488067200,"day":{"maxtemp_c":5.2,"mintemp_c":1.0,"avgtemp_c":3.5,"maxwind_kph":28.1,
"astro":{"sunrise":"06:34 AM",...
獲取數據,我編程的天氣應用,但是當我想訪問,例如,日期,那麼Android Studio中說有:用於預測沒有價值。這是我如何獲得數據:從JSONObject的在JSONArray從JSONObject的
JSONObject jsonObject = new JSONObject(data);
[...]
JSONObject forecastObject = Utils.getObject("forecast", jsonObject);
JSONArray forecastArray = forecastObject.getJSONArray("forecastday");
JSONObject forecastWeather = forecastArray.getJSONObject(0);
weather.currentCondition.setDate(Utils.getString("date", forecastWeather));
JSONObject dayObject = Utils.getObject("day", forecastWeather);
我在做什麼錯?你可以幫我嗎?
[獲取的JSONObject的可能的複製從JSONArray](http://stackoverflow.com/questions/7634518/getting-jsonobject-from-jsonarray) –