Tell the WebView to use the wide viewport and loads a page with overview mode. - Android User Interface

Android examples for User Interface:WebView

Description

Tell the WebView to use the wide viewport and loads a page with overview mode.

Demo Code


//package com.java2s;

import android.webkit.WebSettings;
import android.webkit.WebView;

public class Main {
    /**//from   w ww.  j a  va  2s. com
     * Tell the WebView to use the wide viewport and loads a page with overview mode.
     * @param webview
     */
    public static final void fitScreenWidth(WebView webview) {
        WebSettings ws = webview.getSettings();
        ws.setUseWideViewPort(true);
        ws.setLoadWithOverviewMode(true);
    }
}

Related Tutorials