Possible Duplicate:
WebView: how to preserve the user's zoom settings across sessions?
I'm developing a simple android app, which loads an initial URL inside my WebView, then the user is free to zoom in/out and navigate.
When the user taps on a link, the "zoom level" is lost (or reset) and the user has to zoom in/out again! This is frustrating users! I couldn't find how to save/preserve the current zoom. (I've tried using the onScaleChanged event, but it seems it is generated only after the user tapped)
I've solved using, inside onPageFinished:
@Override
public void onPageFinished(WebView webView, String url) {
webView.loadUrl("javascript:(function() { " +
"document.getElementsByTagName('body')[0].style.zoom='" + yourzoomvariable + "'; })()");
}
Thank you very much for the help!