示例#1
0
    @Override
    public void onRefresh(PullToRefreshBase refreshView) {
      if (refreshView.isShownHeader()) {

        String nowTime =
            DateUtils.formatDateTime(
                getActivity(),
                System.currentTimeMillis(),
                DateUtils.FORMAT_SHOW_TIME
                    | DateUtils.FORMAT_SHOW_DATE
                    | DateUtils.FORMAT_ABBREV_ALL);
        refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(nowTime);

        String pathURL =
            URLs.TEMAIZHONG
                + "&"
                + URLs.PG_CUR
                + "="
                + 1
                + "&"
                + URLs.PG_SIZE
                + "="
                + PAGE_SIZE_NUM;

        new RequestDataThreadForTMZ(pathURL).start();

      } else if (refreshView.isShownFooter()) {

        tmz_Cur_Num += 1;
        String pathURL =
            URLs.TEMAIZHONG
                + "&"
                + URLs.PG_CUR
                + "="
                + tmz_Cur_Num
                + "&"
                + URLs.PG_SIZE
                + "="
                + PAGE_SIZE_NUM;
        new RequestDataThreadForTMZ(pathURL).start();
      }
    }