protected override void OnDestroy() { base.OnDestroy(); //Unbind events unlocker.Touch -= Unlocker_Touch; clearAll.Click -= BtnClearAll_Click; WallpaperPublisher.NewWallpaperIssued -= Wallpaper_NewWallpaperIssued; CatcherHelper.NotificationListSizeChanged -= CatcherHelper_NotificationListSizeChanged; lockscreen.Touch -= Lockscreen_Touch; watchDog.Stop(); watchDog.Elapsed -= WatchdogInterval_Elapsed; watchDog.Dispose(); //Dispose Views //Views recycler.Dispose(); unlocker.Dispose(); clearAll.Dispose(); lockscreen.Dispose(); wallpaper.Background.Dispose(); wallpaper.Dispose(); //Dispose Fragments notificationFragment.Dispose(); musicFragment.Dispose(); clockFragment.Dispose(); weatherFragment.Dispose(); StopFloatingNotificationService(); }
protected override void OnDestroy() { base.OnDestroy(); OnActivityStateChanged?.Invoke(null, new LockScreenLifecycleEventArgs { State = ActivityStates.Destroyed }); //Unbind events OnActivityStateChanged -= LockScreenActivity_OnActivityStateChanged; //unlocker.Touch -= Unlocker_Touch; clearAll.Click -= BtnClearAll_Click; WallpaperPublisher.NewWallpaperIssued -= Wallpaper_NewWallpaperIssued; CatcherHelper.NotificationListSizeChanged -= CatcherHelper_NotificationListSizeChanged; lockscreen.Touch -= Lockscreen_Touch; watchDog.Stop(); watchDog.Elapsed -= WatchdogInterval_Elapsed; watchDog.Dispose(); //Dispose Views //Views recycler.Dispose(); //unlocker.Dispose(); clearAll.Dispose(); lockscreen.Dispose(); //wallpaperView.Background?.Dispose(); //wallpaperView = null; viewPropertyAnimator.Dispose(); //Dispose Fragments notificationFragment.Dispose(); musicFragment.Dispose(); clockFragment.Dispose(); weatherFragment.Dispose(); livedisplayinfo?.Dispose(); }