Пример #1
0
        private void MoveToBeforeCreateLifecycleState()
        {
            lock (_lifecycleStateLock)
            {
                if (_currentReactContext != null)
                {
                    if (_lifecycleState == LifecycleState.Foreground)
                    {
                        _currentReactContext.OnEnteredBackground();
                        _lifecycleState = LifecycleState.Background;
                    }
                    if (_lifecycleState == LifecycleState.Background)
                    {
                        _currentReactContext.OnSuspend();
                        _lifecycleState = LifecycleState.Suspended;
                    }
                    if (_lifecycleState == LifecycleState.Suspended)
                    {
                        _currentReactContext.OnDestroy();
                    }
                }

                _lifecycleState = LifecycleState.BeforeCreate;
            }
        }