MainActivity.cs 757 B

123456789101112131415161718192021222324
  1. using System;
  2. using Android.App;
  3. using Android.Content.PM;
  4. using Android.OS;
  5. using Android.Views;
  6. using Microsoft.Xna.Framework;
  7. namespace PrimitivesSample.Android
  8. {
  9. [Activity(Label = "Primitives Sample",
  10. MainLauncher = true,
  11. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden,
  12. ScreenOrientation = ScreenOrientation.Landscape)]
  13. public class MainActivity : AndroidGameActivity
  14. {
  15. protected override void OnCreate(Bundle? bundle)
  16. {
  17. base.OnCreate(bundle);
  18. var game = new PrimitivesSampleGame();
  19. SetContentView((View)game.Services.GetService(typeof(View))!);
  20. game.Run();
  21. }
  22. }
  23. }