I have the same issue.
Here is my current workaround:
Create your custom shadow (for example ShadowMapActivityWorkaround) from the ShadowMapActivity (get it from robolectric sources)
Make the following changes:
public void __constructor__() {
super.__constructor__();
}
and
@Implementation
public void onResume() {
registerReceiver(connectivityBroadcastReceiver, new IntentFilter());
field("mCalled").ofType(boolean.class).in(realActivity).set(true);
}
add the shadow to org.robolectric.Config.properties for example:
shadows: com.mytests.shadows.ShadowMapActivityWorkaround