public override void ViewDidLoad() { base.ViewDidLoad(); if (AppManager.CurrentApplication.Error == null) { ViewModel.ShowMenu(); } else { UIAlertView alert = new UIAlertView(); alert.Title = "Error"; alert.AddButton("OK"); alert.Message = AppManager.CurrentApplication.Error.Message; alert.Clicked += (object s, UIButtonEventArgs ev) => { Process.GetCurrentProcess().Kill(); NSThread.Exit(); }; alert.Show(); } }
static void TerminateApplication() { Console.WriteLine("Closing the running application to re-launch..."); Console.WriteLine("Trying Exit Option 1..."); Exit(0); Console.WriteLine("Option 1 failed. Trying Exit Option 2..."); NSThread.Exit(); Console.WriteLine("Option 2 failed. Trying Exit Option 3..."); TerminateWithSuccess(); Console.WriteLine("Option 3 failed. Trying Exit Option 4..."); throw new Xamarin.iOS.HotRestart.KillApplicationException(); }
public void CloseApp() { NSThread.Exit(); }