只要将PullToRefreshListView源码中的:
@Override
protected void onRefreshing(final boolean doScroll) {
/**
* If we‘re not showing the Refreshing view, or the list is empty, the
* the header/footer views won‘t show so we use the normal method.
*/
// ListAdapter adapter = mRefreshableView.getAdapter();
// if (!mListViewExtrasEnabled || !getShowViewWhileRefreshing() || null == adapter || adapter.isEmpty()) {
// super.onRefreshing(doScroll);
// return;
// }
下面注释的部分注释掉再在想刷新的地方加上:
mPullToRefreshListView.setRefreshing(true);
就行了
时间: 2024-10-31 23:34:47