Chrome for Android version 86.0.4240.75 was released just a few days ago. The rollout has barely started, but we're seeing a new crash whose numbers are going straight up, on devices using that version of Chrome / Android System WebView.
val intent = Intent(Intent.ACTION_VIEW)
intent.setDataAndType(Uri.parse(url), "text/html")
intent.addCategory(Intent.CATEGORY_BROWSABLE)
startActivity(intent)
It looks like for any url, on any device using version 86.0.4240.75, the above code crashes with ActivityNotFoundException:
android.content.ActivityNotFoundException: No Activity found to handle Intent
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1854)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1544)
Seems like a bug in Chrome, but has anyone figured out a workaround yet?
A bit surprising, but I found an easy workaround. Actually two: remove the MIME type or remove the category.
This works fine even with 86.0.4240.75:
This does too:
(I'm not sure what the benefit of defining
text/html
orCATEGORY_BROWSABLE
was in the first place, as neither seems mandatory.)