Activity1.cs 979 B

123456789101112131415161718192021222324252627282930313233343536
  1. #if ANDROID
  2. using Android.App;
  3. using Android.Content.PM;
  4. using Android.OS;
  5. using Android.Views;
  6. using Microsoft.Xna.Framework;
  7. namespace CollisionSample
  8. {
  9. [Activity(
  10. Label = "@string/app_name",
  11. MainLauncher = true,
  12. Icon = "@drawable/icon",
  13. AlwaysRetainTaskState = true,
  14. LaunchMode = LaunchMode.SingleInstance,
  15. ScreenOrientation = ScreenOrientation.FullSensor,
  16. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
  17. )]
  18. public class Activity1 : AndroidGameActivity
  19. {
  20. private CollisionGame _game;
  21. private View _view;
  22. protected override void OnCreate(Bundle bundle)
  23. {
  24. base.OnCreate(bundle);
  25. _game = new CollisionGame();
  26. _view = _game.Services.GetService(typeof(View)) as View;
  27. SetContentView(_view);
  28. _game.Run();
  29. }
  30. }
  31. }
  32. #endif