小智 5
您可以检查是否可以解析访问网页的意图:
public Boolean isBrowserInstalled() {
String url = "https://stackoverflow.com";
Uri webAddress = Uri.parse(url);
Intent intentWeb = new Intent(Intent.ACTION_VIEW, webAddress);
return (intentWeb.resolveActivity(getPackageManager()) != null);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1857 次 |
| 最近记录: |