How to create a WebView in android app?
This example demonstrates how do I create a WebView in android app. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. <? xml version = "1.0" encoding = "utf-8" ?> <RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:id = "@+id/parent" xmlns:tools = "http://schemas.android.com/tools" android:layout_width = "match_parent" android:layout_height = "match_parent" tools:context = ".MainActivity" > <WebView android:id = "@+id/webView" android:layout_width = "match_parent" android:layout_height = "match_parent" > </WebView> </RlativeLayout> Step 3 − Add the following code to src/MainActivity.java import and