1. 程式人生 > >上拉下拉重新整理資料

上拉下拉重新整理資料

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));
			}
		}
	};