Reputation: 41
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 ?
Upvotes: 3
Views: 1398
Reputation: 69671
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.
Upvotes: 1
Reputation: 101
You need to tell your SwipeRefreshLayout
to stop refreshing just like to tell it to start refreshing.
setRefreshing(true)
to show the refresh indicator.
setRefreshing(false)
to remove the refresh indicator.
If this does not help, please provide more details on your code.
Upvotes: 0