MainActivity.cs 867 B

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