Search in sources :

Example 1 with LifecycleEventListener

use of com.facebook.react.bridge.LifecycleEventListener in project maps by rnmapbox.

the class RCTMGLMapView method setLifecycleListeners.

private void setLifecycleListeners() {
    final ReactContext reactContext = (ReactContext) mContext;
    mLifeCycleListener = new LifecycleEventListener() {

        @Override
        public void onHostResume() {
            onResume();
        }

        @Override
        public void onHostPause() {
            onPause();
        }

        @Override
        public void onHostDestroy() {
            dispose();
        }
    };
    reactContext.addLifecycleEventListener(mLifeCycleListener);
}
Also used : ReactContext(com.facebook.react.bridge.ReactContext) LifecycleEventListener(com.facebook.react.bridge.LifecycleEventListener)

Aggregations

LifecycleEventListener (com.facebook.react.bridge.LifecycleEventListener)1 ReactContext (com.facebook.react.bridge.ReactContext)1