I am showing a webpage in an Android WebView. The page needs to be scaled to fit the available width of the WebView.
HTML (width 550 is just an example, that could change):
<html>
<head>
<meta name="viewport" content="width=550">
...
Java:
mWebView = (WebView)findViewById(R.id.webView);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setHorizontalScrollBarEnabled(false);
mWebView.setVerticalScrollBarEnabled(false);
mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.getSettings().setLoadWithOverviewMode(true); // required for scaling
mWebView.getSettings().setUseWideViewPort(true); // required for scaling
mWebView.loadUrl(someUrl);
This works fine, except one problem: double-tab triggers a switch between overview mode and default scale.
Is there any way to disable this functionality?
Btw: I cannot calculate the scale in the code, because the loaded pages might have different sizes, which I do not know beforehand. I also already checked the source code of WebView, but do not see anything, that I could override or change.