List of usage examples for com.facebook.react ReactInstanceManager onHostPause
@ThreadConfined(UI) public void onHostPause(Activity activity)
From source file:org.jitsi.meet.sdk.JitsiMeetActivityDelegate.java
License:Apache License
/** * {@link Activity} lifecycle method which should be called from * {@code Activity#onPause} so we can do the required internal processing. * * @param activity {@code Activity} being paused. *///from w w w . ja v a2 s .co m public static void onHostPause(Activity activity) { ReactInstanceManager reactInstanceManager = ReactInstanceManagerHolder.getReactInstanceManager(); if (reactInstanceManager != null) { // Try to avoid a crash because some devices trip on this assert: // https://github.com/facebook/react-native/blob/df4e67fe75d781d1eb264128cadf079989542755/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java#L512 // Why this happens is a mystery wrapped in an enigma. ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (activity == reactContext.getCurrentActivity()) { reactInstanceManager.onHostPause(activity); } } }