简体   繁体   English

简单 https URI 意图上的 Android ActivityNotFoundException

[英]Android ActivityNotFoundException on simple https URI Intent

I am launching a web page when user clicks a button in my app.当用户单击我的应用程序中的按钮时,我正在启动 web 页面。

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.example.com"))
                    startActivity(intent)

It works on every device I have tested but I am getting crash logs from Crashlytics stating No Activity found to handle Intent { act=android.intent.action.VIEW (has data) } .它适用于我测试过的每台设备,但我从 Crashlytics 收到崩溃日志,指出No Activity found to handle Intent { act=android.intent.action.VIEW (has data) }

It seems to only be on Amazon Fire devices.它似乎只在 Amazon Fire 设备上。

Obviously I can just check that the intent resolves first before I try to start the activity but I wanted to actually replicate the bug and confirm the fix.显然,我可以在尝试开始活动之前检查意图是否首先解决,但我想实际复制错误并确认修复。

Could the user have uninstalled the web browser?用户是否可以卸载 web 浏览器? It seems strange as I have had quite a few of these crashes and they just seem to have started recently.这似乎很奇怪,因为我遇到了很多这样的崩溃,而且它们似乎是最近才开始的。

Could the user have uninstalled the web browser?用户是否可以卸载 web 浏览器?

Possibly, but that's not what I'm thinking of.有可能,但我想的不是这个。 A Fire TV might not have a Web browser. Fire TV 可能没有 Web 浏览器。 Also, a restricted profile running your app might not have access to a Web browser (eg, a shared tablet where parents limit the apps available to kids).此外,运行您的应用程序的受限配置文件可能无法访问 Web 浏览器(例如,父母限制孩子可以使用的应用程序的共享平板电脑)。

Overall, though, you cannot assume that the current user has access to a Web browser.但总的来说,您不能假设当前用户可以访问 Web 浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android ActivityNotFoundException意图 - Android ActivityNotFoundException Intent Android:StreetView意图导致ActivityNotFoundException - Android:StreetView intent causing ActivityNotFoundException 从uri打开Epub ActivityNotFoundException错误Android - Open Epub from uri ActivityNotFoundException Error Android android.content.ActivityNotFoundException:将url传递给intent - android.content.ActivityNotFoundException: passing url to the intent 使用Intent的android.content.ActivityNotFoundException - android.content.ActivityNotFoundException using Intent [Android]context.startActvity(intent) 抛出 ActivityNotFoundException - [Android]context.startActvity(intent) throwing ActivityNotFoundException Android Intent数据失败并且Intent解析返回ActivityNotFoundException - Android Intent data fails and intent resolution returns ActivityNotFoundException 使用简单的自定义提供程序接收content:/// URI(ActivityNotFoundException) - Receiving content:/// URI's with a simple custom provider (ActivityNotFoundException) Android错误:“ android.content.ActivityNotFoundException:未找到用于处理Intent的活动” - Android error : “android.content.ActivityNotFoundException: No Activity found to handle Intent” Android:android.content.ActivityNotFoundException:找不到处理 Intent 的活动 - Android: android.content.ActivityNotFoundException: No Activity found to handle Intent
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM