MainActivity.cs 856 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using Android.App;
  3. using Android.Content;
  4. using Android.Runtime;
  5. using Android.Views;
  6. using Android.Widget;
  7. using Android.OS;
  8. namespace FormulaOneApp.Classic.Android
  9. {
  10. [Activity(Label = "FormulaOneApp.Classic.Android", MainLauncher = true, Icon = "@drawable/icon")]
  11. public class MainActivity : Activity
  12. {
  13. int count = 1;
  14. protected override void OnCreate(Bundle bundle)
  15. {
  16. base.OnCreate(bundle);
  17. // Set our view from the "main" layout resource
  18. SetContentView(Resource.Layout.Main);
  19. // Get our button from the layout resource,
  20. // and attach an event to it
  21. Button button = FindViewById<Button>(Resource.Id.MyButton);
  22. button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
  23. }
  24. }
  25. }