-
Notifications
You must be signed in to change notification settings - Fork 1k
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(android): resolve issue with activity result API registration for fragments #4402
Conversation
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.
I think we could have a helper on Bridge class that help us get the activity or fragment that is going to register for result, something like this:
public ActivityResultCaller getResultCaller() {
if (this.fragment != null) {
return this.fragment;
} else {
return this.context;
}
}
This way we can avoid having the fragment null check and having to duplicate the code that is called once with getFragment
and another one with getActivity when
registerForActivityResult` is used
Thanks for the idea, this does make it cleaner. Take a look what I added |
Looks good, can you use it in BridgeWebChromeClient too? |
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.
looks good!
Prerequisite: #4405