We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried to invoke Android's system file browser UI (SAF) but get following error message: No appropriate Activity found to handle this intent.
No appropriate Activity found to handle this intent.
Try following code:
from android.content import Intent intent = Intent(Intent.ACTION_OPEN_DOCUMENT) intent.addCategory(Intent.CATEGORY_OPENABLE) intent.setType("*/*") result = await self.app._impl.intent_result(intent)
The system file browser should open because under my Android 13, it is definitely there.
With following code, the file browser is shown, but the app doesn't wait for the result:
intent = Intent(Intent.ACTION_OPEN_DOCUMENT) intent.addCategory(Intent.CATEGORY_OPENABLE) intent.setType("*/*") result = await self.app._impl.native.startActivityForResult(intent, 1234)
I get the error back object NoneType can't be used in 'await' expression
object NoneType can't be used in 'await' expression
No response
The same problem exists with Intent.ACTION_CREATE_DOCUMENT and this Intent also can be invoked directly with startActivityForResult
The problem stems from this code in app.py:
if not intent.resolveActivity(self.native.getPackageManager()): raise RuntimeError("No appropriate Activity found to handle this intent.")
This may be a good way to find Activities of standard apps, but it seems to fail in the case of internal Activities like the system file browser.
It might be better to remove this code and instead catch and return exceptions that occur when invoking startActivityForResult unguarded
The text was updated successfully, but these errors were encountered:
Fixed bug mentioned in beeware#1909
93761d4
For future reference: there's a complete example of using the system file browser at #1158 (comment).
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
I tried to invoke Android's system file browser UI (SAF) but get following error message:
No appropriate Activity found to handle this intent.
Steps to reproduce
Try following code:
Expected behavior
The system file browser should open because under my Android 13, it is definitely there.
With following code, the file browser is shown, but the app doesn't wait for the result:
I get the error back
object NoneType can't be used in 'await' expression
Screenshots
No response
Environment
Logs
Additional context
The same problem exists with Intent.ACTION_CREATE_DOCUMENT and this Intent also can be invoked directly with startActivityForResult
The problem stems from this code in app.py:
This may be a good way to find Activities of standard apps, but it seems to fail in the case of internal Activities like the system file browser.
It might be better to remove this code and instead catch and return exceptions that occur when invoking startActivityForResult unguarded
The text was updated successfully, but these errors were encountered: