Exam AND-401 All QuestionsBrowse all questions from this exam
Question 29

How to enable JavaScript in WebView?

    Correct Answer: C

    JavaScript is disabled in a WebView by default. To enable it, you need to access the WebSettings attached to the WebView. You can retrieve WebSettings with the method getSettings() on the WebView instance. After retrieving WebSettings, you can enable JavaScript by calling setJavaScriptEnabled(true) on the WebSettings instance.

Discussion
MmadiOption: C

C. myWebView.getSettings().setJavaScriptEnabled(true);