Use a Timer

Hey there!
I'm new in developing Android apps using Xamarin, so here's my question. My timer is not working, where is the problem?

           public class MainActivity : Activity
            {

                protected override void OnCreate(Bundle bundle)
                {
                    base.OnCreate(bundle);
                    SetContentView(Resource.Layout.SplashScreen);
                    ActionBar.Hide();
                    System.Timers.Timer Timer1 = new System.Timers.Timer();
                    Timer1.Interval = 3000;
                    Timer1.Enabled = true;
                    Timer1.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) =>
                    {
                        Timer1.Stop();
                        SetContentView(Resource.Layout.MainMenu);
                    };
                    Timer1.Start();
                    }
            }
Tagged:

Best Answer

Answers

  • GerryHGerryH USMember ✭✭✭

    why is the timer started twice?

Sign In or Register to comment.