我正在尝试在Chrome自定义标签页
中打开PDF文件
,以下代码可正常使用:
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse("https://docs.google.com/viewerng/viewer?url=" +pdflink));
但问题是,如果用户在应用设置中禁用了Chrome,并且没有其他浏览器,它就会崩溃。那么如果Chrome被禁用,我该如何在自定义Chrome选项卡中打开它。
提前致谢。
这是在日志中显示的异常。
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://docs.google.com/... (has extras) }