[英]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.