I am trying to set up a pull to refresh feature like chrome (swipe refresh layout). The loading bar disappears after pull. How can i fix this?
I've tried various code samples from stack overflow... but none of them seem to work. Swipe to refresh works but disappears right after pull.
Swipe refresh in main activity java
mySwipeRefreshLayout = this.findViewById(R.id.swipeContainer);
mySwipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
browser.reload();
mySwipeRefreshLayout.setRefreshing(false);
}
}
);
I Just want the loading icon to load till the full page is refreshed like chrome.