解决方案 »

  1.   

    用JSONObject解析太麻烦,直接下个gson或者jackson插件解析吧
      

  2.   

    在你的json数据里,weather是个数组,你看它的数据是用[和]界定的;如果是对象的话,就用{和}界定。
    所以你应该这么写:JSONArray jsonWeathers = (JSONArray)object.getJSONObject("weather"); 
    for (int i = 0; i < jsonWeathers .length(); i++) {
    JSONObject jsonWeather = jsonWeathers.getJSONObject(i);
    // ...
    }
      

  3.   

    其实用JSONObject和JSONArray已经很方便了,没有必要再引入第三方库。
      

  4.   

    weather数组中还嵌套了个数组,是继续在循环中再做循环吗?