I am trying to test my app using the MonkeyRunner tool. I am trying to add an EXTRA to my activity. The python script executes without error:
device = MonkeyRunner.waitForConnection()
device.wake()
extra = {'MY_EXTRA', True}
device.startActivity(component="org.mycompany.myapp/.activity.Show",extras=extra)
But when I inspect the intent in my app I do not get the value passed:
boolean myExtra = i.getBooleanExtra("MY_EXTRA", false);
What am I missing? Am I passing in the intent wrong? Am I inspecting the value in the Android app wrong?
This is a bug in MonkeyRunner
. It is not correctly handling passing boolean
into extras. If you pass a string instead, it should work.
This fixes this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With