解决方案 »

  1.   

    test  Jsonobject
    {
     "result":{
              "code":0,
              "message":"message",
              "sucess":true
    }
    }
    Jsonobject  json = test.getjsonobject("result");
    int code = json.getint("code");
    String message = json.getString("message");
    boolean sucess = json.getboolean("sucess")
      

  2.   

    看在你有80分的份上就给你弄个demo。
      

  3.   

    已经按照你的要求解析了数据,做好了demo,去下载吧
    http://download.csdn.net/detail/lulong1985/8287581
      

  4.   

    我刚做完一个项目,使用的是jackson ,感觉非常方便,推荐给你使用
      

  5.   

    谢谢。你这个好像有问题,文字是解析出来了,但是图片有问题。
    要是用listView去展示就好了。
      

  6.   

    恩恩,我刚刚看了你的json中的images是数组类型的,我开始以为是object,你改一下public static LinkedList<news> getFansParse(JSONArray jsonArray)这个方法就行public static LinkedList<news> getFansParse(JSONArray jsonArray) {
    JSONObject json = null;
    int len = jsonArray.length();
    LinkedList<news> fans = new LinkedList<news>();
    try {
    for (int i = 0; i < len; i++) {
    json = jsonArray.getJSONObject(i);
    news f = new news();
    f.setGid(JsonParserTolls.getStr(json, "gid"));
    f.setTitle(JsonParserTolls.getStr(json, "title"));
    f.setTime(JsonParserTolls.getStr(json, "time"));
    f.setCommentNum(JsonParserTolls.getStr(json, "commentNum"));
    f.setFavoriteNum(JsonParserTolls.getStr(json, "favoriteNum"));
    f.setImageNum(JsonParserTolls.getStr(json, "imageNum"));
    JSONArray newjsonArray=JsonParserTolls.getJsonArray(json, "images");
    String url=newjsonArray.getString(0);
    f.setImages(url);
    Log.e("ldebug", "newjsonArray" + url);
    fans.add(f);
    }
    } catch (JSONException e) {
    e.printStackTrace();
    }
    return fans;
    }