指定浏览器,调用系统自带浏览器打开网页链接:

Intent intent = new Intent();intent.setAction("android.intent.action.VIEW");Uri content_url = Uri.parse("http://www.baidu.com");   intent.setData(content_url);  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setClassName("com.android.browser","com.android.browser.BrowserActivity");mContext.startActivity(intent);

不指定浏览器,此时若设备设置了默认浏览器,则打开的默认浏览器,否则如果设备中有多个浏览器则会弹窗让用户选择要打开哪个浏览器:

Uri uri = Uri.parse("http://www.baidu.com");Intent intent = new Intent();intent.setAction("android.intent.action.VIEW");intent.setData(uri);startActivity(intent);

更多相关文章

  1. Android(安卓)解析CSV文件,中文乱码
  2. Android(安卓)TextView 给文本中指定片段添加自定义点击事件
  3. Android实现指定区域截屏的实现
  4. Intent在Android中的几种用法
  5. 如何修改android开机启动默认横竖屏
  6. android设置多个类似APP其中的一个为默认
  7. android 让 webView 中的超链接失效
  8. android和html交互--动态注入方法
  9. Android(安卓)launcher3 -- launcher3源码1

随机推荐

  1. Android的常用adb命令
  2. Android(安卓)4.4 KitKat 更新内容
  3. Android(安卓)Retrofit 框架上传多张图片
  4. 【学习Android(安卓)NDK开发】native cod
  5. Android:只读EditText内容可滚动(禁止输
  6. Android 蓝牙状态机以及蓝牙启动状态机
  7. Android事件分发机制
  8. Tiny210(Android)串口收发测试通过
  9. android 流量统计实现思路
  10. TextView中ellipsize属性焦点异常处理