Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwipeRefresh indicator Stuck

Tags:

android

I use a SwipeRefreshLayout to reload the content of a listview .But the indicator get stuck each time of loading .Is there any way to fix this issue ?

like image 720
Santhiya Avatar asked Feb 04 '26 03:02

Santhiya


1 Answers

The SwipeRefreshLayout will notify the listener each and every time the gesture is completed again; the listener is responsible for correctly determining when to actually initiate a refresh of its content. If the listener determines there should not be a refresh, it must call setRefreshing(false) to cancel any visual indication of a refresh. If an activity wishes to show just the progress animation, it should call setRefreshing(true). To disable the gesture and progress animation, call setEnabled(false) on the view.

setRefreshing Notify the widget that refresh state has changed. Do not call this when refresh is triggered by a swipe gesture.

setRefreshing(true) //to show the refresh indicator.
setRefreshing(false) to remove the refresh indicator.
like image 59
AskNilesh Avatar answered Feb 13 '26 09:02

AskNilesh