init WebView With Url - Android User Interface

Android examples for User Interface:WebView URL

Description

init WebView With Url

Demo Code


//package com.java2s;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class Main {
    public static final void initWithUrl(WebView webview, String url) {
        WebSettings webSettings = webview.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setUseWideViewPort(true);
        webSettings.setLoadWithOverviewMode(true);
        webSettings.setUseWideViewPort(true);
        webSettings.setDomStorageEnabled(true);
        webview.loadUrl(url);/*from  ww w  .j av  a2  s.c  om*/
    }
}

Related Tutorials