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 intent_result is not documented #1798

Closed
mhsmith opened this issue Feb 26, 2023 · 1 comment · Fixed by #2353
Closed

Android intent_result is not documented #1798

mhsmith opened this issue Feb 26, 2023 · 1 comment · Fixed by #2353
Labels
android The issue relates to Android mobile support. documentation An improvement required in the project's documentation.

Comments

@mhsmith
Copy link
Member

mhsmith commented Feb 26, 2023

#1217 added an Android-specific intent_result method, but it isn't documented. Normally we wouldn't document anything that uses a private, underscore-prefixed API, but in this case we can't simply tell people "call the standard Android APIs via Chaquopy", because the API for calling Intents is bound up with Toga's Activity class.

The documentation should be something like this:

Once you've created an Intent object, you should await self._impl.intent_result(intent), where self is your App object. That will return a dict with two keys: resultCode and resultData, which correspond to the arguments of the onActivityResult method.

For a complete example, see #1158 (comment).

@mhsmith mhsmith added android The issue relates to Android mobile support. documentation An improvement required in the project's documentation. labels Feb 26, 2023
@freakboy3742
Copy link
Member

The fact that it's not documented is at least partially intentional; it's an internal API, and most users shouldn't have any need to use it.

However, it's definitely a detail of the internal implementation that warrants documentation, as anyone wanting to build new Android features needs to know how the MainActivity maps to the Toga implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. documentation An improvement required in the project's documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants