MainActivity.cs 886 B

1234567891011121314151617181920212223242526
  1. using Android.App;
  2. using Android.Content.PM;
  3. using Android.OS;
  4. using MonoGame.Framework;
  5. namespace ParticleSample.Android
  6. {
  7. [Activity(
  8. Label = "ParticleSample",
  9. MainLauncher = true,
  10. Icon = "@mipmap/icon",
  11. Theme = "@style/MainTheme",
  12. ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize,
  13. ScreenOrientation = ScreenOrientation.FullSensor
  14. )]
  15. public class MainActivity : AndroidGameActivity
  16. {
  17. protected override void OnCreate(Bundle savedInstanceState)
  18. {
  19. base.OnCreate(savedInstanceState);
  20. var game = new ParticleSampleGame();
  21. SetContentView((game.Services.GetService(typeof(Android.Views.View)) as Android.Views.View));
  22. game.Run();
  23. }
  24. }
  25. }