0% found this document useful (0 votes)
1K views

Android - Remove Loading Spinner in SwipeRefreshLayout - Stack Overflow

The document is a Stack Overflow post that discusses how to remove the loading spinner in a SwipeRefreshLayout after data has finished loading. It provides answers from other users that explain you need to call setRefreshing(false) on the SwipeRefreshLayout object once loading is complete to make the spinner dismiss. Calling this method sets the refreshing state to false and hides the loading indicator.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Android - Remove Loading Spinner in SwipeRefreshLayout - Stack Overflow

The document is a Stack Overflow post that discusses how to remove the loading spinner in a SwipeRefreshLayout after data has finished loading. It provides answers from other users that explain you need to call setRefreshing(false) on the SwipeRefreshLayout object once loading is complete to make the spinner dismiss. Calling this method sets the refreshing state to false and hides the loading indicator.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

3/3/2017 androidRemoveloadingspinnerinSwipeRefreshLayoutStackOverflow

xDismiss

JointheStackOverflowCommunity

Stack Overflow is a community of 6.8 million


programmers, just like you, helping each other.
Join them it only takes a minute:

Signup

RemoveloadingspinnerinSwipeRefreshLayout

IuseaSwipeRefreshLayouttoreloadthecontentofalistview.ItworksandtheonRefreshListeneristriggeredbutthesmallloadingspinnerthat
appearsonswipedoesn'twanttodismissaftertheloadingiscomplete.Isthereawaytomakeitgo?

Edit:fixedSwipeViewmeansSwipeRefreshLayout

android swipeview

editedFeb18'15at11:58 askedFeb18'15at11:30
Labe
396 7 22

3Answers

Doyoumean SwipeRefreshLayout ?ifsouse SwipeRefreshLayout.setRefreshing(false)

answeredFeb18'15at11:35
TheRedFox
1,230 1 8 20

Yesitwaswhatimeant.IcorrectedtheViewnamemistakeintheop.Thankyouyoursolutionworks!
Labe Feb18'15at12:00

Ihavethisscenario,gettingJSONdatafromserver.AndhowtotestifitisalreadyloadedsothatSRLcan
bedismisssettofalseRoCk Jun9'16at13:48

Thecorrectwayofusingitislikethis:

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

answeredFeb18'15at12:18
dvs
314 2 9

Savedmyyear!Thanks!LaraBelleJan5at9:26

Ifyouareusing SwipeRefreshLayout thenuse swipeLayout_object.setRefreshing(false); for


dismissthatloadingicon.i.e.

http://stackoverflow.com/questions/28582544/removeloadingspinnerinswiperefreshlayout 1/2
3/3/2017 androidRemoveloadingspinnerinSwipeRefreshLayoutStackOverflow
privateSwipeRefreshLayoutswipeLayout;

protectedvoidonCreate(BundlesavedInstanceState){
....

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

swipeLayout.setOnRefreshListener(newSwipeRefreshLayout.OnRefreshListener(){

@Override
publicvoidonRefresh(){
//Doyourtask
swipeLayout.setRefreshing(false);

}
});
}

Detailsavailablehere.
https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html

answeredFeb18'15at11:47
MukeshKumar
3,115 2 12 25

http://stackoverflow.com/questions/28582544/removeloadingspinnerinswiperefreshlayout 2/2

You might also like