-1

I am showing html file in web view , on that Web view I am having one button on bottom .After that scrolled down that html page I want to move top of that web view once clicking on that button .

I need some one's advice to rectify this immediately. Thanks.

Aks
  • 1
  • 4

1 Answers1

0
webView.scrollTo(0,0);

The given function will work good if the whole page is loaded on WebView.Moreover you can disable the button till the Page is loaded in the webview and then enable it, so that scrolling to top works fine.

webview.setWebViewClient(new WebViewClient(){

    @Override
    public void onPageFinished(WebView view, String url) {
        button.setEnabled(true);
    }

}
);
aagam94
  • 613
  • 1
  • 6
  • 20
  • Thanks for response in my case webView.scrillTo(0,0); not working , I have putted that code inside button click listener, better u can see on below link. http://stackoverflow.com/questions/16785206/view-pager-contains-html-files-inside-webview-that-scroll-by-button-to-top-or-b – Aks Jun 11 '13 at 10:58