Sets the WebView supports zoom and sets whether the zoom mechanism built into WebView is used. - Android android.webkit

Android examples for android.webkit:WebView

Description

Sets the WebView supports zoom and sets whether the zoom mechanism built into WebView is used.

Demo Code

import android.app.Activity;
import android.util.Log;
import android.view.Display;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class Main{

    /**/*from www.  j  ava2 s  .co m*/
     * Sets the WebView supports zoom and sets whether the zoom mechanism built into WebView is used.
     * @param webview
     * @param showControler
     */
    public static final void supportZoom(WebView webview,
            boolean showControler) {
        WebSettings ws = webview.getSettings();
        ws.setSupportZoom(true); // double-tap zoom and keep pinch 
        ws.setBuiltInZoomControls(showControler);
    }

}

Related Tutorials