您的位置:首页 > 移动开发 > Android开发

Android利用Intent如何打开网页

2012-04-26 22:50 330 查看
一、打开链接
 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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: