Whenever I reload a webpage in my webview, it goes to top of page. Is there any way to not going to top of page and scroll again after auto reload?
4 Answers
If you have the amount the user scrolled down already you can use something like this. Where once loaded will scroll down to the selected value with mWebView.scrollTo(0, 1000000000);
mWebView.setWebViewClient(new WebViewClient()
{
@Override
public void onPageFinished(WebView view, String url)
{
super.onPageFinished(view, url);
Handler lHandler = new Handler();
lHandler.postDelayed(new Runnable()
{
@Override
public void run()
{
mWebView.scrollTo(0, 1000000000);
}
}, 200);
}
});

- 82
- 2
- 11
You can't do this in a proper way, you can achieve it by using scrollTo method to point out some position. But after auto loading you will be top then only you can use scrollTo method.

- 296
- 2
- 13
You can achieve this by coordinating with your web developer.
With the help of JavaScript you can pass parameter to your Web page loaded in WebView. And your Web developer can easily scroll their HTML page.
To call JavaScript method,
view.loadUrl("javascript:WEB_YOURMETHOD();");
You need to embed JavaScript method in your URL while loading.

- 1,529
- 1
- 18
- 27
solved with some suggestions. //in onPageFinished
x = (int) scrollview.getScaleX();
y = (int) scrollview.getScaleY();
and
define your value of x,y where you want
wv.reload();
wv.scrollTo(x,y);
where you want

- 13
- 1
- 8