开发者

how to display web view in android

开发者 https://www.devze.com 2023-02-20 14:00 出处:网络
Intent intent = new Intent(this, MainActivit开发者_高级运维y.class); startActivity(intent);To start a browser:

Intent intent = new Intent(this, MainActivit开发者_高级运维y.class); startActivity(intent);


To start a browser:

Uri uri = Uri.parse("http://www.example.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

to start a WebView inside your Activity:

WebView webview = new WebView(this);
setContentView(webview);
webview.loadUrl("http://stackoverflow.org/");

It's all explained here: http://developer.android.com/reference/android/webkit/WebView.html

0

精彩评论

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