小编Anm*_*317的帖子

如果用户在其设备中禁用了 Chrome 浏览器,Chrome 自定义选项卡会崩溃

我想开pdf filechrome custom tab,它通过使用此代码工作正常

CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse("https://docs.google.com/viewerng/viewer?url=" +pdflink));
Run Code Online (Sandbox Code Playgroud)

但问题是,如果用户从应用程序设置中禁用了 chrome,并且没有其他浏览器,它就会崩溃。那么如果它被禁用,我如何在 chrome 自定义选项卡中打开它。

提前致谢。

这是出现在 logcat 中的异常。

 Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://docs.google.com/... (has extras) }
Run Code Online (Sandbox Code Playgroud)

browser pdf android chrome-custom-tabs

3
推荐指数
1
解决办法
2379
查看次数

标签 统计

android ×1

browser ×1

chrome-custom-tabs ×1

pdf ×1