Activity1.cs 801 B

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