MainActivity shows pages in a WebView, and its WebViewClient.shouldOverrideUrlLoading sends links that are not allowed in the app to an external app with startActivity(Intent(Intent.ACTION_VIEW, url)). The call is not guarded, so a link that no installed app can open throws ActivityNotFoundException and crashes the app.
On a device with no browser, or a link whose scheme nothing handles, tapping the link closes the app.
Catching the failure and showing a short message would keep the app running. Allowed pages and normal links are unaffected.
MainActivityshows pages in a WebView, and itsWebViewClient.shouldOverrideUrlLoadingsends links that are not allowed in the app to an external app withstartActivity(Intent(Intent.ACTION_VIEW, url)). The call is not guarded, so a link that no installed app can open throwsActivityNotFoundExceptionand crashes the app.On a device with no browser, or a link whose scheme nothing handles, tapping the link closes the app.
Catching the failure and showing a short message would keep the app running. Allowed pages and normal links are unaffected.