Andrew McFaul
Andrew McFaul

Reputation: 203

Android ActivityNotFoundException on simple https URI Intent

I am launching a web page when user clicks a button in my app.

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) }.

It seems to only be on Amazon Fire devices.

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? It seems strange as I have had quite a few of these crashes and they just seem to have started recently.

Upvotes: 2

Views: 132

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006539

Could the user have uninstalled the web browser?

Possibly, but that's not what I'm thinking of. A Fire TV might not have a Web browser. Also, a restricted profile running your app might not have access to a Web browser (e.g., a shared tablet where parents limit the apps available to kids).

Overall, though, you cannot assume that the current user has access to a Web browser.

Upvotes: 0

Related Questions