title: MvvmCross - How to make navigation call to Mvx View from UIApplication Xamarin.iOS
body: <p>My goal is to redirect user back to login screen after idle timed out. I have this code to countdown after each click/touch. It works well but my current problem is I have no idea to redirect user back to login screen. Since this is MvvmCross 4.4 project, there is not much documentation to look for. If I can also get the example code for Android, that would be very helpful. I will appreciate.</p>
  
  <p>Below is the code I put in Main.cs</p>
  
  <pre><code>public class Application{  
  
      static void Main(string[] args){  
          //UIApplication.Main(args, null, "AppDelegate");  
          UIApplication.Main(args, "MyApplication", "AppDelegate");  
      }  
  
  }  
  
  //DELEGATE  
  [Register("MyApplication")]  
  public class MyApplication : UIApplication {  
  
      public override void SendEvent(UIEvent uievent) {  
          base.SendEvent(uievent);  
          var allTouches = uievent.AllTouches;  
          if (allTouches.Count &gt; 0) {  
              var phase = ((UITouch)allTouches.AnyObject).Phase;  
              if (phase == UITouchPhase.Began || phase == UITouchPhase.Ended)  
                  ResetIdleTimer();  
          }  
      }  
  
      NSTimer idleTimer;  
      void ResetIdleTimer() {  
          if (idleTimer != null) {  
              idleTimer.Invalidate();  
              idleTimer.Dispose();  
          }  
  
          idleTimer = NSTimer.CreateScheduledTimer(TimeSpan.FromMinutes(0.5), TimerExceeded);  
      }  
  
      void TimerExceeded(NSTimer obj) {  
  
          MvxiOSToastService toastService = new MvxiOSToastService();
          toastService.DisplayMessageAndDoSomething("You are going to be timed out.","Idle time exceeded.", RedirectToLogin);  
  
          Console.WriteLine("idle time exceeded");  
      }  
  
      void RedirectToLogin() {  
  
          var window = UIApplication.SharedApplication.KeyWindow;  
          var vc = window.RootViewController;  
  
          //ERROR HERE  
          var nextVC = new LoginView();   
          vc.ShowViewController(nextVC, this);  
          //----------
      }  
  }  
  </code></pre>