AND-401 Exam QuestionsBrowse all questions from this exam

AND-401 Exam - Question 29


How to enable JavaScript in WebView?

Show Answer
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

1 comment
Sign in to comment
MmadiOption: C
Dec 31, 2022

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