title: Can't close AlertDialog using timer, custom view and Xamarin
body: <p>I want to make a splash screen using AlertDialog.Builder, a custom view and a timer.</p>
  
  <p>I'm using Xamarin.Android - i don't have the 'dismiss' method it seems, i can call 'dispose' but the alertDialog view does not close.</p>
  
  <p>Example code below:</p>
  
  <pre><code>public class SplashDialog
  {
      private readonly AlertDialog.Builder _alert;
      private readonly View _view;
  
  
      public SplashDialog(Context context)
      {
          _alert = new AlertDialog.Builder(context);
  
          var layoutInflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);
          _view = layoutInflater.Inflate(Resource.Layout.splash, null);
          _alert.SetView(_view);
  
      }
  
      public void Show()
      {
          _alert.Show();
  
        /*
          new Thread(() =&gt;
          {
              Thread.Sleep(3000);
              _view.Dispose();
              _alert.Dispose();
  
          }).Start();
           * */
  
          new Handler().PostDelayed(() =&gt;
              {
                  _view.Dispose();
                  _alert.Dispose();
  
              }, 3000);
      }
  }
  </code></pre>