Android provides an interface to encapsulate the browser, allowing developers to use their view to display Web content. Today, we have studied again, using WebView to display browser content, you can also use Webviewclient to display what you need.
Reference: http://developer.android.com/reference/android/webkit/WebView.html
The effect is as follows:
The above two pictures are the first page, when you click on java. You can see that there is no address bar on the browser. This is the content that is displayed using Webviewclient. The relevant code is as follows:
WebView WV; @Override Public voidonCreate (Bundle icicle) {Super. OnCreate (Icicle); Setcontentview (R.layout.main); WV=(WebView) Findviewbyid (R.ID.WV1); Wv.loadurl ("Wv.setwebviewclient (NewWebviewclientdemo ()); } Private classWebviewclientdemoextendswebviewclient {@Override//display the page in WebView instead of the default browser Public Booleanshouldoverrideurlloading (WebView view, String URL) {view.loadurl (URL); return true; } }
Source code:http://wangjun-memory.googlecode.com/svn/trunk/helloWebView/