Skip to content

Handle missing browser when opening nearby links - #100

Merged
Pygmalion69 merged 1 commit into
masterfrom
codex/add-try/catch-around-startactivity-in-nearbyfragment
Sep 27, 2026
Merged

Pygmalion69 merged 1 commit into
masterfrom
codex/add-try/catch-around-startactivity-in-nearbyfragment

Conversation

@Pygmalion69

Copy link
Copy Markdown
Owner

Motivation

  • Prevent crashes in NearbyFragment.onItemClick() when startActivity() throws ActivityNotFoundException for external (e.g. Wikipedia) links.
  • Do not add a <queries> manifest entry because package-visibility declarations do not install an intent handler and would not prevent startActivity() from throwing.

Description

  • Import ActivityNotFoundException and Toast and wrap startActivity(browserIntent) with a try/catch in NearbyFragment.onItemClick().
  • On ActivityNotFoundException, display the existing R.string.no_browser_found toast instead of crashing.
  • No manifest or other files were modified.

Testing

  • Ran git diff --check and git diff --cached --check, both passed.
  • Attempted ./gradlew compileFossDebugKotlin, but the build could not run in this environment due to a missing Android SDK location (local.properties/ANDROID_HOME).
  • No unit or instrumentation tests were executed in this environment.

Codex Task

@Pygmalion69
Pygmalion69 merged commit 05489d6 into master Sep 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant