布局文件:
<com.handmark.pulltorefresh.library.PullToRefreshListView android:id="@+id/list_view" android:layout_width="match_parent" android:layout_height="match_parent" android:fadingEdge="none" android:fastScrollEnabled="false" android:footerDividersEnabled="false" android:headerDividersEnabled="false" android:smoothScrollbar="true" android:descendantFocusability="blocksDescendants" />
类:
mListView = (PullToRefreshListView) findViewById(R.id.list_view); mListView.setOnItemClickListener(this); mListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() { @Override public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
//在执行完之后调用 使下拉刷新的状态取消
mListView.onRefreshComplete();
} @Override public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) { } });