web-dev-qa-db-fra.com

Comment activer le script Java dans webView

Dans Android si j'utilise le script Java dans webView, cela donne Force Close. Existe-t-il des possibilités d'utilisation du script Java dans webView? s'il vous plaît aider ...

01-10 10:08:51.513: W/dalvikvm(5994): JNI WARNING: jarray 0x407447a8 points to non-array object (Ljava/lang/String;)
01-10 10:08:51.513: I/dalvikvm(5994): "WebViewCoreThread" prio=5 tid=9 NATIVE
01-10 10:08:51.513: I/dalvikvm(5994):   | group="main" sCount=0 dsCount=0 obj=0x40567400 self=0x1f9e58
01-10 10:08:51.513: I/dalvikvm(5994):   | sysTid=6010 Nice=0 sched=0/0 cgrp=default handle=2269896
01-10 10:08:51.513: I/dalvikvm(5994):   | schedstat=( 44479977019 41285891893 14352 )
01-10 10:08:51.513: I/dalvikvm(5994):   at Android.webkit.WebViewCore.nativeTouchUp(Native Method)
01-10 10:08:51.513: I/dalvikvm(5994):   at Android.webkit.WebViewCore.nativeTouchUp(Native Method)
01-10 10:08:51.543: I/dalvikvm(5994):   at Android.webkit.WebViewCore.access$3300(WebViewCore.Java:53)
01-10 10:08:51.543: I/dalvikvm(5994):   at Android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.Java:1158)
01-10 10:08:51.543: I/dalvikvm(5994):   at Android.os.Handler.dispatchMessage(Handler.Java:99)
01-10 10:08:51.543: I/dalvikvm(5994):   at Android.os.Looper.loop(Looper.Java:123)
01-10 10:08:51.543: I/dalvikvm(5994):   at Android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.Java:629)
01-10 10:08:51.557: I/dalvikvm(5994):   at Java.lang.Thread.run(Thread.Java:1019)
01-10 10:08:51.557: E/dalvikvm(5994): VM aborting
34
Dhanesh

JavaScript est désactivé par défaut dans une WebView.

WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
85
Vamsi Krishna B
 WebView webView = (WebView) findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
7
Mina Fawzy