Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue ActivityNotFoundException on Utils#openURL #3963

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

gustamor
Copy link
Contributor

@gustamor gustamor commented Oct 22, 2023

The previous code had a bug that makes an ActivityNotFoundException when a user tries to open a URL on a system with any browser enabled, which is common on Oculus devices, for instance. This commit uses PackageManager to check if there is any webview enabled. It includes the following changes:

  • Added PackageManager query to find a match with any enabled webview.
  • Starts the activity only if there is a match.
  • Logs a warning when there is no webview.
  • Displays a Toast message indicating that no browser is available.
  • Added some translations of the message

This fix resolves the reported bug and improves the overall user experience when opening URLs.

Description

Issue tracker

Fixes: #3756

Automatic tests

  • Added test cases

Manual tests

  • Done
  • Device: Generic Android Emulator
  • OS: Android 10, Android 13 without Google API and browsers disabled

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

The previous code had a bug that makes an ActivityNotFoundException when a user tries to open a URL on a system with any browser enabled, which is common on Oculus devices, for instance. This commit uses PackageManager to check if there is any webview enabled. It includes the following changes:

- Added PackageManager query to find a match with any enabled webview.
- Starts the activity only if there is a match.
- Logs a warning when there is no webview.
- Displays a Toast message indicating that no browser is available.
- Added some translations of the message

This fix resolves the reported bug and improves the overall user experience when opening URLs.

Fixes: TeamAmaze#3756
@gustamor
Copy link
Contributor Author

@TranceLove What do you think of these changes?

VishnuSanal
VishnuSanal previously approved these changes Oct 24, 2023
Copy link
Member

@VishnuSanal VishnuSanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome work, thanks for fixing this!

PS: we do not encourage adding translations directly to the code. please use Transifex for translations. @VishalNehra please verify whether we can merge it as is, or should these changes be reverted?

VishalNehra
VishalNehra previously approved these changes Oct 30, 2023
@VishalNehra VishalNehra dismissed stale reviews from VishnuSanal and themself via 093ae42 October 30, 2023 00:11
@VishalNehra VishalNehra merged commit 68a1f93 into TeamAmaze:release/4.0 Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActivityNotFoundException on Utils#openURL
3 participants