How can I pass Extra into Android intent using MonkeyRunner?

I am trying to test my application using the MonkeyRunner tool. I am trying to add EXTRA to my activity. Python script runs without errors:

device = MonkeyRunner.waitForConnection() device.wake() extra = {'MY_EXTRA', True} device.startActivity(component="org.mycompany.myapp/.activity.Show",extras=extra) 

But when I check the intent in my application, I do not get the passed value:

 boolean myExtra = i.getBooleanExtra("MY_EXTRA", false); 

What am I missing? Am I wrong in intention? Am I checking the value in an Android application incorrectly?

+6
android monkeyrunner
source share
1 answer

This is a bug in MonkeyRunner . It is not correct to handle passing boolean to additional functions. If you pass a string instead, it should work.

This fixes this problem.

+4
source share

All Articles