WebView:WebView is a view used to display the web pages in application. This class is the basis upon which you can roll your own web browser or simply use it to display some online content within your Activity. We can also specify HTML string and can show it inside our application using a WebView. Basically, WebView turns application into a web application.

Step 1: Open up Android Studio Project through res -> layout -> activity_main.xml (or) main.xml and add below code or just drag and drop the switch to design XML file.

Step 2: Add below code in MainActivity.java.