I want to implement Swipe To Refresh in my WebView, is it possible? I know I have Pull To Refresh but I can not download add-ons (dependencies) at the moment. I researched a lot on the internet and found something like this:
browser.loadUrl("http://urlaqui");
swipeView.setColorScheme(android.R.color.holo_blue_dark,android.R.color.holo_blue_light, android.R.color.holo_green_light,android.R.color.holo_green_dark);
swipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener()
{
@Override
public void onRefresh()
{
swipeView.setRefreshing(true);
( new Handler()).postDelayed(new Runnable()
{
@Override
public void run()
{
swipeView.setRefreshing(false);
browser.loadUrl("http://não-atualizar-somente-esta-url");
}
}, 4000);
}
});
}
In this case, when the user refreshes, he will always return to the url specified. How do you refresh the page regardless of which url you are?
Thank you very much, thank you in advance.