向浏览器发送打开特定URL的意图我只是想知道如何启动一个意图到手机的浏览器打开一个特定的URL,并显示它。谁能给我个提示吗?
3 回答
慕桂英4014372
TA贡献1871条经验 获得超13个赞
android.content.ActivityNotFoundException: No Activity found to handle Intent
if (!url.startsWith("https://") && !url.startsWith("http://")){ url = "http://" + url;}Intent openUrlIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));startActivity(openUrlIntent);
- 3 回答
- 0 关注
- 453 浏览
添加回答
举报
0/150
提交
取消