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 passingboolean
into extras. If you pass a string instead, it should work.This fixes this issue.