/** * Use this method when the activity resumes to enable invoking the back button directly from JS. * * <p>This method retains an instance to provided mDefaultBackButtonImpl. Thus it's important to * pass from the activity instance that owns this particular instance of {@link * ReactInstanceManagerImpl}, so that once this instance receive {@link #onDestroy} event it will * clear the reference to that defaultBackButtonImpl. * * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns * this instance of {@link ReactInstanceManagerImpl}. */ @Override public void onResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) { UiThreadUtil.assertOnUiThread(); mLifecycleState = LifecycleState.RESUMED; mDefaultBackButtonImpl = defaultBackButtonImpl; if (mUseDeveloperSupport) { mDevSupportManager.setDevSupportEnabled(true); } mCurrentActivity = activity; if (mCurrentReactContext != null) { mCurrentReactContext.onResume(activity); } }