Open alixwar opened 6 years ago
Debugger:
When it's still OK in the call stack:
When it's converted to something faulty (this will also be the end result in the assertion):
It looks like android.support.v4.app.FragmentActivity does some weird stuff with the request code:
ActivityCompat.startActivityForResult(this, intent, (requestIndex + 1 << 16) + (requestCode & '\uffff'), options);
OK, I managed to avoid this situation:
Previously I launched the new activity from a fragment instead of from the parent activity. Launching the activity from the parent activity solved my problem.
Weird behavior anyway... So I leave this ticket open for someone to look into what this means for Robolectric...
Just ran into this issue trying out the new FragmentScenario api -- it would be great if the EmptyFragmentActivity's Shadow did something to record the original request code it was given rather than having to figure out what it is after the FragmentActivity processes it.
Description
The request code changes value during the course of the test. The real value was 2 and was converted to 65538
Steps to Reproduce
Code:
Test code:
Robolectric & Android Version
Robolectric 4.0 Config: @Config(sdk = Build.VERSION_CODES.LOLLIPOP) @RunWith(AndroidJUnit4.class)