SwipeRefreshView重複下拉重新整理操作閃退問題

愛吃草的二狗發表於2018-09-10
private void initEvent(final ListAdapter listAdapter) {
    //下拉重新整理
    pushDrugsList.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            if (listAdapter != null) {
                pushDrugsList.resetFoot();
                listAdapter.notifyDataSetChanged();
            }
            pageNo = 1;         //頁碼重置為1
            prolist.clear();
            getSame();
            if (pushDrugsList.isRefreshing()) {
                listAdapter.notifyDataSetChanged();
                pushDrugsList.setRefreshing(false);//設定不重新整理
            }
        }
    });
    //上拉載入
    pushDrugsList.setOnLoadMoreListener(new SwipeRefreshView.OnLoadMoreListener() {
        @Override
        public void onLoadMore() {
            loadMore();
        }
    });
}

相關文章