Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.imiyoo.com"));
it.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
getContext().startActivity(it);
二、打开本地网页
Intent intent=new Intent();
intent.setAction("android.intent.action.VIEW");
Uri CONTENT_URI_BROWSERS = Uri.parse("content://com.android.htmlfileprovider/sdcard/123.html");
intent.setData(CONTENT_URI_BROWSERS);
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);
本文介绍如何在Android应用中使用Intent打开网页链接及本地HTML文件,通过设置ACTION_VIEW和特定的数据URI实现浏览器调用。
172

被折叠的 条评论
为什么被折叠?



