1.调用默认浏览器并直接打开
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
2.弹出一个选择浏览器的框,选择浏览器再进入:
Intent intent= new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri content_url = Uri.parse(url);
intent.setData(content_url);
startActivity(Intent.createChooser(intent, “请选择一款浏览器”);
转自:https://segmentfault.com/a/1190000003912694
Tags: 安卓