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

Android plugin documentation missing details for handling Intent for Result #2019

Closed
domoosterloo opened this issue Oct 1, 2019 · 2 comments · Fixed by #2066
Closed

Android plugin documentation missing details for handling Intent for Result #2019

domoosterloo opened this issue Oct 1, 2019 · 2 comments · Fixed by #2066

Comments

@domoosterloo
Copy link

Documentation in https://capacitor.ionicframework.com/docs/plugins/android/ section Intents with result, missing the fact you need to register your requestCode in the plugin class @NativePlugin annotation for handleOnActivityResult to be called.

Using the example in the documentation:
static final int REQUEST_IMAGE_PICK = 12345;
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(call, intent, REQUEST_IMAGE_PICK);

For this to work the plugin class would also require:
@NativePlugin(
requestCodes={MyPlugin.REQUEST_IMAGE_PICK}
)
public class MyPlugin extends Plugin {
....

@LukaszGrela
Copy link

Relates to #1983

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 13, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants