Use the WebView control in the same way as other controls use a <WebView> label in layout
WebView does not include the navigation bar, the address bar and other full browser functions, only for displaying a Web page
Load a Web page in WebView, using loadurl ()
WebView Mywebview = (WebView) Findviewbyid (R.id.webview); Mywebview.loadurl ("http://www.example.com");
Note include access to the Internet in the manifest file:
XML code
<uses-permission android:name= "Android.permission.INTERNET"/>
Click on a link in Android, the default is to invoke the application to start, so webview need to handle this action on behalf of Webviewclient
Java code
Set Webviewclient webview.setwebviewclient (New Webviewclient () {public Boolean shouldoverrideurlloading ( WebView view, String URL) { view.loadurl (URL); return true; } public void onpagefinished (WebView view, String URL) { super.onpagefinished (view, URL); } public void onpagestarted (WebView view, String URL, Bitmap favicon) { super.onpagestarted (view, URL, favicon); } });
Developing Android (2) using HTML5 to build HTML5 apps---Android