I have this small method:
private fun showWebsiteWithUrl(url: String) {
val i = Intent(Intent.ACTION_VIEW)
i.data = Uri.parse(url)
startActivity(i)
}
And I see in google play that sometimes this method throw android.content.ActivityNotFoundException
exception.
The url
parameter is a valid url like this: http://www.stackoverflow.com/
This is the beginning of the stacktrace:
Caused by android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://wwww.stackoverflow.com/... }
I can't reproduce the issue on my phone, the user got this error on Huawei Y5 (DRA-L21) Android 8 and sometimes on Xiaomi devices with android 9.