I'm doing unit testing using the ActivityInstrumentationTestCase2. Is there a way to add extras to the activity so when the activity gets to a line like this
Bundle extras = getIntent().getExtras();
it will return extras?
You can call setActivityIntent in your tests setUp() method before ever calling getActivity, to change the intent that's used to launch the activity under test. This intent will then become the one returned by getIntent() in your activity.
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