private void loadHeaderVp(List<News> newsList) { if (newsList != null && newsList.size() > 0) { for (int i = 0; i < 3; i++) { News news = newsList.get(i); XUtils.returnBitMap(handler, XUtils.BURL + news.getNewsUrl(), news.getNid()); } } }
private void loadNews(final boolean isFlush) { if (pageIndex == null || pageIndex.equals("")) { pageIndex = 1; } RequestParams params = new RequestParams(); params.addBodyParameter("pageSize", String.valueOf(5)); params.addBodyParameter("pageIndex", String.valueOf(pageIndex)); params.addBodyParameter("tid", String.valueOf(tid)); if (!MyApp.isWelcome) { isLoading = false; } else { isLoading = true; } XUtils.send( XUtils.QUERYNEWSES, params, new MyCallBack<Result<List<News>>>(new TypeReference<Result<List<News>>>() {}) { @Override public void success(Result<List<News>> result) { lv.onRefreshComplete(); if (result.state == Result.STATE_SUC) { if (isFlush) { adapter.clear(); } loadHeaderVp(result.data); adapter.addAll(result.data); pageIndex++; } } @Override public void failure() { lv.onRefreshComplete(); super.failure(); } }, isLoading); }