load Url to WebView - Android android.webkit

Android examples for android.webkit:WebView

Description

load Url to WebView

Demo Code

import android.annotation.SuppressLint;
import android.content.Context;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class Main {

  @SuppressLint("SetJavaScriptEnabled")
  public static void loadUrl(Context mContext, WebView webview, String url, boolean javaScriptEnabled) {
    WebSettings webSettings = webview.getSettings();
    webSettings.setJavaScriptEnabled(javaScriptEnabled);
    webview.setWebViewClient(new WebViewClient());
    webview.loadUrl(url);//from   w  w w  .  ja  v a2s  .  c o  m
  }

}

Related Tutorials