Disclaimer: this is my first ever Android test project with Robotium.
I'm facing a catch-22 situation with ActiveAndroid and Robotium. Here's my setup:
- I want to test an activity that expects a long array extra. This array contains DB ids of ActiveAndroid objects.
- To get the ActiveAndroid objects ids', I need to initialize ActiveAndroid first, calling
ActiveAndroid.initialize(this.getActivity())
from myActivityInstrumentationTestCase2
class. - The call to
getActivity()
fails since I didn't pass the long array extra. I can't create the long array extra because I haven't initialized ActiveAndroid, hence the catch-22.
Is there another way I can get a context in a test class? An application-wide context perhaps?