I am struggling with documentation SwipeRefreshLayoutfrom the Google Support Library.
When I receive an update call using the callback installed setOnRefreshListener, I perform my action, and after that I find that I need to set the update status to false again - if I DO NOT do this, I can never run it again by checking!
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
if (mSwipeRefreshLayout != null) {
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Toast.makeText(getApplication(), "Refreshing!", Toast.LENGTH_SHORT).show();
mSwipeRefreshLayout.setRefreshing(false);
}
});
}
So far so good. But look at the documentation setRefreshing:
public void setRefreshing(boolean refreshing) {...
But setting the update status to false again is exactly what I have to do after the update!
Is the documentation wrong or am I seeing it wrong? Should the doctor rather say: "Do not call this with the updated state true when the update is started with a swipe gesture"?
?