MainActivity.cs 960 B

123456789101112131415161718192021222324252627282930313233
  1. using Android.App;
  2. using Android.Content.PM;
  3. using Android.OS;
  4. using Android.Views;
  5. using Microsoft.Xna.Framework;
  6. namespace PerformanceMeasuring
  7. {
  8. [Activity(
  9. Label = "Performance Measuring",
  10. MainLauncher = true,
  11. AlwaysRetainTaskState = true,
  12. LaunchMode = LaunchMode.SingleInstance,
  13. ScreenOrientation = ScreenOrientation.FullUser,
  14. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
  15. )]
  16. public class MainActivity : AndroidGameActivity
  17. {
  18. private PerformanceMeasuringGame _game;
  19. private View _view;
  20. protected override void OnCreate(Bundle bundle)
  21. {
  22. base.OnCreate(bundle);
  23. _game = new PerformanceMeasuringGame();
  24. _view = _game.Services.GetService(typeof(View)) as View;
  25. SetContentView(_view);
  26. _game.Run();
  27. }
  28. }
  29. }