Skip to content

Crash opening an out of scope link when no app can handle it #3

Description

@jim-daf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions