2

I'm having problems while doing tests with Robotium, passing parcelables and injecting them with Roboguice.

As I've read on other places, I'd have to do this to pass intent extras

@Override
protected void setUp() throws Exception {
    super.setUp();
    Instrumentation instrumentation = getInstrumentation();
    Intent intent = new Intent(instrumentation.getTargetContext(), ConfirmOfferActivity.class);
    intent.putExtra(PARCELABLE_OFFER, MockOffer.create());
    setActivityIntent(intent);
}

Now, when I try to run the tests I get this exception on the ConfirmOffer Fragment

    Reason: java.lang.IllegalStateException: Can't find the mandatory extra identified by key [com.parcelable.offer] on field class com.activity.offers.confirm.ConfirmOfferFragment.mOffer

Anyone?

Javier Manzano
  • 4,761
  • 16
  • 56
  • 86

0 Answers0