config WebView - Android android.webkit

Android examples for android.webkit:WebView

Description

config WebView

Demo Code

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

public class Main{

    public static void config(WebView webView) {
        webView.setFocusable(true);//w w w.j a  va2 s  .c  o  m
        webView.setFocusableInTouchMode(true);
        webView.setInitialScale(1);
        WebSettings settings = webView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setPluginState(WebSettings.PluginState.ON_DEMAND);
        settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setDomStorageEnabled(true);
        settings.setDatabaseEnabled(true);
        settings.setAppCacheEnabled(true);
    }

}

Related Tutorials