ITeye博客

浏览器中打开指定的链接

lynen · 2014-09-05 18:21 · android · code snippet · 移动开发 · Markdown

浏览器中打开指定的链接

try {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse(mCurrentUrl));
            this.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            //需要增加此异常处理的原因是:手机上可能没有安装浏览器
        }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。