private void moveToBeforeResumeLifecycleState() { if (mCurrentReactContext != null) { if (mLifecycleState == LifecycleState.BEFORE_CREATE) { mCurrentReactContext.onHostResume(mCurrentActivity); mCurrentReactContext.onHostPause(); } else if (mLifecycleState == LifecycleState.RESUMED) { mCurrentReactContext.onHostPause(); } } mLifecycleState = LifecycleState.BEFORE_RESUME; }
private void tearDownReactContext(ReactContext reactContext) { UiThreadUtil.assertOnUiThread(); if (mLifecycleState == LifecycleState.RESUMED) { reactContext.onHostPause(); } for (ReactRootView rootView : mAttachedRootViews) { detachViewFromInstance(rootView, reactContext.getCatalystInstance()); } reactContext.destroy(); mDevSupportManager.onReactInstanceDestroyed(reactContext); mMemoryPressureRouter.removeMemoryPressureListener(reactContext.getCatalystInstance()); }
private void moveToBeforeCreateLifecycleState() { if (mCurrentReactContext != null) { if (mLifecycleState == LifecycleState.RESUMED) { mCurrentReactContext.onHostPause(); mLifecycleState = LifecycleState.BEFORE_RESUME; } if (mLifecycleState == LifecycleState.BEFORE_RESUME) { mCurrentReactContext.onHostDestroy(); } } mLifecycleState = LifecycleState.BEFORE_CREATE; }