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

android Intent打开URL链接

2011-05-13 10:06 274 查看
一、打开链接

Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: