Course Content

Course Content

Creating WebView Application

Creating WebView Application


Now in this video we are going to create a webView application in which we will load Google page.

First of all we will design the layout of our application. In main.xml file we have take one simple linear layout and a button. And in webview.xml file we are creating a WebView providing with basic height and width.

After that in its manifest file AndroidManifest.xml we need to provide one permission ie.,

<uses-permission android:name="android.permission.INTERNET"/>

Now we will code inside the Java file where we have two different activities, one is and other one is

Now inside our file we will code the following,

public class WebViewActivity extends Activity


private WebView webView;

public void onCreate (Bundle savedInstanceState)







String customHtml="<html><body><h1>Hello, WebView</h1></body></html>";



Now inside our file we will code the following,


button.setOnClickListener(new onClickListener()



public void onClick(View arg0)


Intent intent=new Intent(context,WebViewActivity.class);




Now we will execute our code. When we execute our code a button of Google page link appears, when we click on it if Internet is available to the emulator, google page will get load. But in case of no Internet availability, the simple text 'Hello WebView' appears in front of our screen.


Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
App Store
397K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
13K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere