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);
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);
相关文章推荐
- Android Intent打开URL链接
- android Intent打开URL链接(动态打开浏览器网页)
- Android URL openConnection无法打开链接
- 【Android】在浏览器中打开url链接,打开Service,复习IntDef
- Android 点击Url(短信链接)打开App 的调研与实现
- 【Android】通过 Intent 调用浏览器打开链接
- Android 利用发送Intent播放本地视频和网络视频(浏览器打开这个URL)
- Android 通知PendingIntent意图打开Activity,数据无更新? 解决方法
- 判断实在pc,android,ios,微信,微博,qq打开链接
- Android杂谈--打开文件的Intent及使用
- android加载网络图片并缓存,对图片进行点击打开相应链接
- Android实现通过浏览器点击链接打开本地应用(APP)并拿到浏览器传递的数据
- android黑科技系列——解析公众号文章消息和链接文章消息自动打开原理
- Android杂谈--打开文件的Intent及使用
- Android实现通过浏览器点击链接打开本地应用(APP)并拿到浏览器传递的数据
- 打开URL启动android默认浏览器,启动指定浏览器
- Android--用intent打开各种文件
- Android通过URL/URI来打开我们的应用
- android用于打开各种文件的intent
- 22、Android Intent应用,打开网页,安装程序,打电话,打开地图等功能