Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to, applicationDidBecomeActive in Xamarin iOS?

How do I do this in Xamarin iOS?

ViewDidAppear is not called when opening app from background

The link below mentions the OnActivated method for Xamarin in the AppDelegate, but how do I subscribe my ViewController so it knows when the app comes from the background?

https://forums.xamarin.com/discussion/10594/where-is-applicationdidbecomeactive-in-xamarin-ios

like image 339
LampShade Avatar asked Feb 11 '23 00:02

LampShade


1 Answers

    NSObject notificationObserver = NSNotificationCenter.DefaultCenter.AddObserver (UIApplication.DidBecomeActiveNotification, DoStuff);

    private void DoStuff (NSNotification a_notification)
    {
        // DO STUFF HERE
    }
like image 176
LampShade Avatar answered Feb 23 '23 00:02

LampShade