Activity1.cs 954 B

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