MainActivity.cs 979 B

12345678910111213141516171819202122232425262728293031323334
  1. using Android.App;
  2. using Android.Content.PM;
  3. using Android.OS;
  4. using Android.Views;
  5. using BatteryStatus;
  6. using Microsoft.Xna.Framework;
  7. namespace Ascent
  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.FullUser,
  16. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
  17. )]
  18. public class MainActivity : AndroidGameActivity
  19. {
  20. private BatteryStatusGame _game;
  21. private View _view;
  22. protected override void OnCreate(Bundle bundle)
  23. {
  24. base.OnCreate(bundle);
  25. _game = new BatteryStatusGame();
  26. _view = _game.Services.GetService(typeof(View)) as View;
  27. SetContentView(_view);
  28. _game.Run();
  29. }
  30. }
  31. }