Esempio n. 1
0
  private ArrayList<MsgModel> parse(JSONObject json) throws JSONException {
    final ArrayList<MsgModel> models = new ArrayList<MsgModel>();

    JSONArray arrs = json.getJSONArray("list");
    int nSize = arrs.length();

    MsgModel model = null;
    for (int idx = 0; idx < nSize; idx++) {
      JSONObject obj = arrs.getJSONObject(idx);
      model = new MsgModel();
      model.mID = obj.getInt("id");
      model.mURL = obj.getString("url");
      model.mBiz = obj.getString("biz");
      model.mContent = obj.getString("content");
      model.mType = obj.getString("type");
      model.mTargetID = obj.getInt("targetId");

      model.mStatus = obj.getInt("status");
      model.mDate = obj.getString("date");
      model.mTitle = obj.getString("title");

      models.add(model);
    }

    return models;
  }