上拉下拉重新整理資料
阿新 • • 發佈:2019-01-22
pRefresh = (PullToRefreshListView) view .findViewById(R.id.listview_fragment_news); lv = pRefresh.getRefreshableView(); pRefresh.setOnRefreshListener(refreshListener); OnRefreshListener refreshListener=new OnRefreshListener<ListView>() { @Override public void onRefresh(PullToRefreshBase<ListView> refreshView) { //上拉時載入 if (refreshView.isFooterShown()) { ShowProgressbarAndHideIcon(); openThread(2,map.get(titlename)+System.currentTimeMillis()+"&min_behot_time="+(System.currentTimeMillis()-1200000)); } else { //下拉時載入 ShowProgressbarAndHideIcon(); openThread(3,map.get(titlename)+System.currentTimeMillis()+"&max_behot_time="+(System.currentTimeMillis()-2400000)); } } };