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(); } }
public void initListData(String objStr) { try { this.initListData(new JSONObject(objStr)); } catch (JSONException e) { mListener.onError(); } }