Enable Javascript for WebView : WebView « UI « Android






Enable Javascript for WebView

   
package app.test;


import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class Test extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        WebView webview = new WebView(this);
 
        webview.getSettings().setJavaScriptEnabled(true);
        webview.loadUrl("http://www.google.com/");

        setContentView(webview);
    }
}

   
    
    
  








Related examples in the same category

1.Adding WebView to Activity, load URL and grab focus
2.Load local resource into WebView
3.Load remote web page for WebView
4.extends WebViewClient and check the url
5.Using WebView to load url
6.Using WebView to load static html string
7.Load static html file into WebView
8.Load Url to WebView
9.Load image from remote host to WebView
10.Add a client to the web view
11.Sample creating 10 webviews.