I needed to build an Android app that lets you view a web page inside my app. I needed this not to be in a browser but my app.
I found the answer and some options for when page is loaded.
I thought I’d try sharing the info I found here, after I tested of course…..
I needed to build an Android app that lets you view a web page
Share
First need to add INTERNET permission to your manifest.
Then, use the WebView class to display a web page. First, create a layout that contains a webview:
In your Activity, (probably the onCreate), initialize a WebView object by using the layout you created. An example is below.
private WebView webview;
If you’d like specific options, like catching pages as they load, you need an inner WebViewClient class. For example, you can use the onPageStarted(…) method to do something whenever a new page is loaded in your webview: