public void resetRootViewForScreenshotTests() { if (mReactInstanceManager != null) { mReactInstanceManager.onDestroy(); mReactInstanceManager = null; } mReactRootView = new ReactRootView(this); mScreenshotingFrameLayout.removeAllViews(); mScreenshotingFrameLayout.addView(mReactRootView); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(0, 0); // We wrap screenshot layout in another FrameLayout in order to handle custom dimensions of the // screenshot view set through {@link #setScreenshotDimensions} FrameLayout rootView = new FrameLayout(this); setContentView(rootView); mScreenshotingFrameLayout = new ScreenshotingFrameLayout(this); mScreenshotingFrameLayout.setId(ROOT_VIEW_ID); rootView.addView(mScreenshotingFrameLayout); mReactRootView = new ReactRootView(this); mScreenshotingFrameLayout.addView(mReactRootView); }