Activity1.cs 968 B

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