public sp_GetMessage_Items(JSONObject obj) { super(obj); try { if (bsuccess) { JSONObject data = obj.getJSONObject("data"); if (data != null) // { // 새 매시지 if (!data.isNull("newmessages")) { JSONArray array = data.getJSONArray("newmessages"); if (array != null) { for (int i = 0; i < array.length(); i++) { newmessages.add(new sp_GetMessage_Result(array.getJSONObject(i))); } } } // 상대방이 읽은 마지막 메시지 if (!data.isNull("readmessage")) readmessage = new sp_GetLatestReadMessage_Result(data.getJSONObject("readmessage")); } else Logger.Instance().Write("sp_GetMessage_Items 파싱중 data가 null임"); } else // 실패시는 errorcode입력 { resultCode = ResultCode.valueOf(obj.getString("data")); } } catch (JSONException e) { Logger.Instance().Write(e); } }
public sp_GetRequestsByDistance_Items(JSONObject obj) { try { bsuccess = obj.getBoolean("success"); if (bsuccess) { JSONArray arr = obj.getJSONArray(""); for (int i = 0, m = arr.length(); i < m; i++) requests.add(new sp_GetRequestsByDistance_Result(arr.getJSONObject(i))); } else { try { resultCode = ResultCode.valueOf(obj.getString("data")); } catch (JSONException e) { Logger.Instance().Write(e); } } } catch (JSONException e) { Logger.Instance().Write(e); } }