Skip to content

External links in the feature attributes view can crash with ActivityNotFoundException #668

@jim-daf

Description

@jim-daf

While reading through the attributes view I noticed that links in the attribute table are opened without checking whether the device can handle them.

In AttributesFragment.java the shouldOverrideUrlLoading handler passes the tapped URL to view.getContext().startActivity(...). If a link points to a web page or another scheme and there is no app registered to handle it, startActivity throws ActivityNotFoundException and the screen crashes. This can happen on minimal builds with no browser and on locked down profiles.

Wrapping the launch in a try/catch avoids the crash and shows a short message instead. I will open a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions