jjzjj

android - 在 TestCase 中启动第二个 Activity (这不是被测 Activity )

如何在ActivityInstrumentationTestCase2或InstrumentationTestCase中启动第二个(模拟)Activity?我的问题是:Intentintent=newIntent(getInstrumentation().getContext(),MyMock.class);myMock=(MyMock)getInstrumentation().startActivitySync(intent);...导致错误“进程中的Intent...解析为不同的进程...测试”。对Intent使用getTargetContext()会导致“无法解析IntentAc