Webview settings enable two fingers to scale the webpage:
Mwebview. getsettings (). setsuppzoom zoom (true );
Mwebview. getsettings (). setbuiltinzoomcontrols (true );
Webview cookies cleanup:
Cookiesyncmanager. createinstance (this );
Cookiesyncmanager. getinstance (). startsync ();
Cookiemanager. getinstance (). removesessioncookie ();
In addition, the method for clearing cache and history records is as follows:
Webview. receivache (true );
Webview. clearhistory ();
Android determines whether webview has been rolled to the bottom of the page:
The getscrolly () method returns the distance from the top of the current visible area to the top of the entire page, that is, the scrolling distance of the current content.
The getheight () or getbottom () Methods return the height of the current webview container.
Getcontentheight returns the height of the entire HTML, but it is not the same as the current height of the entire page, because webview has the zoom function,
Therefore, the current height of the entire page is actually the height of the original HTML and then multiplied by the scaling ratio.
Therefore, the correct result should be:
If (webview. getcontentheight * webview. getscale () = (webview. getheight () + webview. getscrolly ())){
// It is already at the bottom
}