@Override protected Void doInBackground(Void... voids) { try { JSONObject contents = new JSONObject(downloadStringFromUrl(URLUtils.ZHIHU_DAILY_BEFORE_URL + date)); if (isFirstPage) { checkDate(getActivity(), contents.getString("date")); } JSONArray newsArray = contents.getJSONArray("stories"); for (int i = 0; i < newsArray.length(); i++) { JSONObject singleNews = newsArray.getJSONObject(i); DailyNews dailyNews = new DailyNews(); dailyNews.setThumbnailUrl( singleNews.has("images") ? (String) singleNews.getJSONArray("images").get(0) : null); dailyNews.setDailyTitle(singleNews.getString("title")); if (!newsList.contains(dailyNews)) { String newsInfoJson = downloadStringFromUrl( URLUtils.ZHIHU_DAILY_OFFLINE_NEWS_URL + singleNews.getString("id")); Document doc = Jsoup.parse(new JSONObject(newsInfoJson).getString("body")); isTheSameContent = false; boolean shouldPublish = updateDailyNews(doc, singleNews.getString("title"), dailyNews); if (shouldPublish) { publishProgress(dailyNews); } } } } catch (JSONException e) { isRefreshSuccess = false; warning(e); } catch (IOException e) { isRefreshSuccess = false; warning(e); } return null; }