internal void Dispose() { if (_disposed) { return; } _disposed = true; FormsAppCompatActivity.BackPressed -= HandleBackPressed; SetPage(null); var activity = _context?.GetActivity(); if (_embedded && activity != null) { PopupManager.Unsubscribe(activity); } }
protected override void OnDestroy() { PreviousActivityDestroying.Reset(); if (_application != null) { _application.PropertyChanging -= AppOnPropertyChanging; _application.PropertyChanged -= AppOnPropertyChanged; } PopupManager.Unsubscribe(this); if (Platform != null) { _layout.RemoveView(Platform); Platform.Dispose(); } PreviousActivityDestroying.Set(); // call at the end to avoid race conditions with Platform dispose base.OnDestroy(); }