When switch fragment with SwipeRefreshLayout during refreshing, fragment freezes but actually still work

Well… After some struggling I eventually solved this problem by myself, in a tricky way…

I just need to add these in onPause() :

@Override
public void onPause() {
    super.onPause();
    ...

    if (mSwipeRefreshLayout!=null) {
        mSwipeRefreshLayout.setRefreshing(false);
        mSwipeRefreshLayout.destroyDrawingCache();
        mSwipeRefreshLayout.clearAnimation();
    }
}

Leave a Comment