android - Stop when WebView is at the end -


i want able scroll webview until has reached end of webview. code below continues scroll down automatically when webview page has reached it's end. want make sure each page scrolls down until end of webview.

webview.loadurl("file:///android_asset/"+position+".html");             webview.getsettings().setbuiltinzoomcontrols(true);             webview.setpicturelistener(new picturelistener() {                  public void onnewpicture(webview view, picture picture) {                     int webbot = webview.getbottom();                      webview.scrollby(0, 1);                 }             }); 

try this, (basically using onpagefinished() instead of onnewpicture())

       wv.setwebviewclient(new webviewclient() {                     @override         public void onpagefinished(webview view, string url) {              // todo auto-generated method stub             super.onpagefinished(view, url);             log.i(tag,"onpagefinished invoked!!");             wv.scrollby(0, wv.getbottom());             }      });  

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -