开发者

Web page embedded within Android application

开发者 https://www.devze.com 2023-04-01 07:12 出处:网络
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

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/");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号