-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[url_launcher] Handling the ActivityNotFoundExeption. #3125
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
525240e
to
a5a20e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a test
@@ -1,3 +1,7 @@ | |||
## 5.7.4 | |||
|
|||
* Added a new `LaunchStatus` to handle the ActivityNotFound exception that `activity.startActivity` can throw. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Let's make this message about what have changed from the plugin's user perspective. e.g maybe something like: "Fixed a crash on Android when there is no activity to handle the URL intent, instead the launch method will now throw a Dart PlatformException." (assuming I got the consequences right, side note: would be helpful to describe the previous bad behavior and the new behavior in the PR description)
9673f35
to
f82e47e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
aad671d
to
ec665fe
Compare
…hat `activity.startActivity` can throw.
improved CHANGELOG.md
improved CHANGELOG.md
0df4072
to
bf3d5cf
Compare
Will land on green |
Catch ActivityNotFoundException and report an error back to the Dart side.
Description
Currently on android when you call the
launch
method with an URL of wich there isn't any app installed that can open this URL, java will throw anActivityNotFoundException
. The user can't catch this exception savely in flutter because it was never catched in java.This PR catches this Exception in java (wich is recommended in the documentation here).
It gives the user the ability to savely catch this exception in flutter.
Related Issues
Issue 66826
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?