How to enable JavaScript in WebView?

How to enable JavaScript in WebView?
A . myWebView. setJavaScriptEnabled(true);
B . myWebView.getJavaScriptSettings.setEnabled(true)
C . myWebView.getSettings().setJavaScriptEnabled(true);
D . Java script is always enabled in WebView

Answer: C

Explanation:

JavaScript is disabled in a WebView by default. You can enable it through the WebSettings attached to your WebView. You can retrieve WebSettings with getSettings(), then enable JavaScript with setJavaScriptEnabled().

For example:

WebView myWebView = (WebView) findViewById(R.id.webview);

WebSettings webSettings = myWebView.getSettings();

webSettings.setJavaScriptEnabled(true);

References:

http://developer.android.com/guide/webapps/webview.html

Latest AND-401 Dumps Valid Version with 228 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>