示例#1
0
  public void initListData(JSONObject obj) throws JSONException {

    JSONObjectHelper helper = new JSONObjectHelper(obj);
    JSONArray array = helper.getJSONArray(Constants.CHANNEL_NAMES, null);
    for (int i = 0; i < array.length(); i++) {
      Channel channel = new Channel(array.getJSONObject(i));
      mChannels.add(channel);
    }
    if (mChannels != null) {
      mListener.onSuccess();
    } else {
      mListener.onError();
    }
  }
示例#2
0
 public void initListData(String objStr) {
   try {
     this.initListData(new JSONObject(objStr));
   } catch (JSONException e) {
     mListener.onError();
   }
 }