1.调用默认浏览器并直接打开
[AppleScript]
纯文本查看
复制代码
1
2
3
|
Uri uri
=
Uri.parse
(
url
)
;
Intent intent
=
new
Intent
(
Intent.ACTION_VIEW
,
uri
)
;
startActivity
(
intent
)
;
|
2.弹出一个选择浏览器的框,选择浏览器再进入:
[AppleScript]
纯文本查看
复制代码
1
2
3
4
5
|
Intent intent
=
new
Intent
(
)
;
intent.setAction
(
Intent.ACTION_VIEW
)
;
Uri content_url
=
Uri.parse
(
url
)
;
intent.setData
(
content_url
)
;
startActivity
(
Intent.createChooser
(
intent
,
“请选择一款浏览器”
)
;
|