Gday all.
Basically what I'm trying to do is embed a webpage within my android application. I know the startActivity(launchBrowser) will open up the browser and display the page externally from the application. However what I want is the page t开发者_高级运维o be displayed within the application say inside an EditText box or something similar. Is that possible at all and can is there a tutorial I can view?
Yes, it's done using a WebView. More info here: http://developer.android.com/reference/android/webkit/WebView.html
I just followed the instructions from the developer reference on the android website but you basically:
Open up the java doc of the activity you want to have a webview in, and place this code in OnCreate()
WebView webview = new WebView(this);
setContentView(webview);
webview.loadUrl("http://google.com/");
精彩评论