Skip to content Skip to sidebar Skip to footer

Remove Loading Spinner In Swiperefreshlayout

I use a SwipeRefreshLayout to reload the content of a listview. It works and the onRefreshListener is triggered but the small loading spinner that appears onswipe doesn't want to

Solution 1:

Do you mean SwipeRefreshLayout? if so use SwipeRefreshLayout.setRefreshing(false)

Solution 2:

The correct way of using it is like this:

if (swipeLayout.isRefreshing()) {
   swipeLayout.setRefreshing(false);
}

Solution 3:

If you are using SwipeRefreshLayout then use swipeLayout_object.setRefreshing(false); for dismiss that loading icon. i.e.

privateSwipeRefreshLayout swipeLayout;

protectedvoidonCreate(Bundle savedInstanceState) {
....


 swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);

 swipeLayout.setOnRefreshListener(newSwipeRefreshLayout.OnRefreshListener() {

                @OverridepublicvoidonRefresh() {
                    //Do your task
                    swipeLayout.setRefreshing(false);

                }
            });
}

Details available here. https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html

Solution 4:

Solution 5:

here is complete solution for loading a page and remove loading animation after page is fully loaded.

privateclassCustomWebViewClientextendsWebViewClient {
@OverridepublicbooleanshouldOverrideUrlLoading(WebView view, String url) {
    view.loadUrl(url);
    returntrue;
}

@OverridepublicvoidonPageFinished(WebView view, String url) {
    swipeRefreshLayout.setRefreshing(false);
}

Post a Comment for "Remove Loading Spinner In Swiperefreshlayout"