@Override public void onFileDownloaded(String jsonString) { if (mListener == null) return; Gson gson = new Gson(); try { GasStationJsonWrapper wrapper = gson.fromJson(jsonString, GasStationJsonWrapper.class); if ((wrapper.stations == null || wrapper.stations.size() == 0) && !mRepeated) { mRepeated = true; (new HttpGetTask(this, getUrl())).execute(); } mListener.onGasStationsParsed(wrapper.stations); } catch (Exception e) { onFailed(e); } }
@Override public void onFailed(Throwable e) { if (mListener == null) return; mListener.onGasStationParserFailed(e); }