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

Intent / data is always null in onActivityResult() #2

Open
kendoboris opened this issue Sep 5, 2015 · 6 comments
Open

Intent / data is always null in onActivityResult() #2

kendoboris opened this issue Sep 5, 2015 · 6 comments

Comments

@kendoboris
Copy link

Pressing the "Click me" button executes the python code in QPython.

However, first of all it requires the user to press a keyboard key to exit the console. Secondly, after leaving the console (by pressing a key) the user is brought to the QPython Log window. Only, then after pressing the back button, the user is brought back to the calling application, and then the Intent data in onActivityResult() is null.

Issues:

  1. can we fix it so that Intent data is not null in onActivityResult()?
  2. is it possible to execute the Python code and obtain the result in the calling application (in onActivityResult()), without any interaction of the user required (so no key press required to close the console or back button to return to the calling application)?
@geovanisouza92
Copy link

I have the same questions. Can anyone help us with this?

@riverfor
Copy link
Member

Please upgrade to the newest qpython version and insert "#qpy:qpyapp" into your script then retry ?

@kendoboris
Copy link
Author

Thanks @riverfor! Your suggestion worked for me.

I have one question left. Following the example from here, on line 112 you are reading out a result from the returned bundle, that is generated by the Python code according to the comment on the same line. In my case, result is always an empty string. How can I return a result from the Python code, such that result is not an empty string?

@rupeshs
Copy link

rupeshs commented Mar 24, 2016

onActivityResult
String result = bundle.getString("result"); // Result your Pycode generate

Result is empty ,how to attach result ?

@bdovaz
Copy link

bdovaz commented Jan 17, 2017

I have the same problem running the sample app without changing a line of code. I geta result of: "onQPyExec: return ()"

Help please.

@bdovaz
Copy link

bdovaz commented Jul 10, 2017

Is still anyone mantaining this repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants