Android provides an interface for encapsulating browsers, allowing developers to display webpage content using their own views. Today, I have made another research. Using webview to display browser content, you can also use webviewclient to display the content you need.
Refer:Http://developer.android.com/reference/android/webkit/WebView.html
The effect is as follows:
The above two figures are respectively on the home page. They are displayed when you click Java. You can see that there is no address bar on the browser. This is the content displayed using webviewclient. RelatedCodeAs follows:
...
Webview WV;
@ Override
Public void oncreate (bundle icicle ){
Super. oncreate (icicle );
Setcontentview (R. layout. Main );
WV = (webview) findviewbyid (R. Id. wv1 );
WV. loadurl ("Http://wangjun.easymorse.com /");
WV. setwebviewclient (New webviewclientdemo ());
}
Private class webviewclientdemo extends webviewclient {
@ Override
// Display the page in webview instead of in the default browser
Public Boolean shouldoverrideurlloading (webview view, string URL ){
View. loadurl (URL );
Return true;
}
}
...
Source Code : http://wangjun-memory.googlecode.com/svn/trunk/helloWebView/