예제 #1
0
        protected override void OnPause()
        {
            _layout.HideKeyboard(true);

            // Stop animations or other ongoing actions that could consume CPU
            // Commit unsaved changes, build only if users expect such changes to be permanently saved when thy leave such as a draft email
            // Release system resources, such as broadcast receivers, handles to sensors (like GPS), or any resources that may affect battery life when your activity is paused.
            // Avoid writing to permanent storage and CPU intensive tasks
            base.OnPause();

            _previousState = _currentState;
            _currentState  = AndroidApplicationLifecycleState.OnPause;

            OnStateChanged();
        }
예제 #2
0
        protected override void OnPause()
        {
            _layout.HideKeyboard(true);

            if (_powerSaveReceiverRegistered && Forms.IsLollipopOrNewer)
            {
                // Don't listen for power save mode changes while we're paused
                UnregisterReceiver(_powerSaveModeBroadcastReceiver);
                _powerSaveReceiverRegistered = false;
            }

            // Stop animations or other ongoing actions that could consume CPU
            // Commit unsaved changes, build only if users expect such changes to be permanently saved when thy leave such as a draft email
            // Release system resources, such as broadcast receivers, handles to sensors (like GPS), or any resources that may affect battery life when your activity is paused.
            // Avoid writing to permanent storage and CPU intensive tasks
            base.OnPause();

            _previousState = _currentState;
            _currentState  = AndroidApplicationLifecycleState.OnPause;

            OnStateChanged();
        }