@Override
 public void onDestroy() {
   Log.d(TAG, "onDestroy");
   super.onDestroy();
   mReactInstanceManager.onPause();
   mReactInstanceManager.onDestroy();
   mReactInstanceManager = null;
 }
  @Override
  protected void onDestroy() {
    super.onDestroy();
    mDestroyCountDownLatch.countDown();

    if (mReactInstanceManager != null) {
      mReactInstanceManager.onDestroy();
    }
  }
 public void resetRootViewForScreenshotTests() {
   if (mReactInstanceManager != null) {
     mReactInstanceManager.onDestroy();
     mReactInstanceManager = null;
   }
   mReactRootView = new ReactRootView(this);
   mScreenshotingFrameLayout.removeAllViews();
   mScreenshotingFrameLayout.addView(mReactRootView);
 }