コード例 #1
0
 /**
  * adapter中成功加载数据回调,无论是加载本地数据,还是网络数据 不管是下拉刷新,还是首次加载数据,都让RotateLoading停止
  * 并且让SwipeRefreshLayout的刷新动作停止
  *
  * @param result
  * @param object
  */
 @Override
 public void onError(int code, String msg) {
   loading.stop();
   ShowToast.Short(ConstantString.LOAD_FAILED);
   if (mSwipeRefreshLayout.isRefreshing()) {
     mSwipeRefreshLayout.setRefreshing(false);
   }
 }
コード例 #2
0
  private void loadCache() {

    mLoadResultCallBack.onSuccess(LoadResultCallBack.SUCCESS_OK, null);
    mLoadFinisCallBack.loadFinish(null);
    PictureCache pictureCacheUtil = PictureCache.getInstance(mActivity);
    if (page == 1) {
      pictures.clear();
      ShowToast.Short(ConstantString.LOAD_NO_NETWORK);
    }
    pictures.addAll(pictureCacheUtil.getCacheByPage(page));
    notifyDataSetChanged();
  }