MainActivity.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // ...existing code from Activity1.cs will be moved here...
  2. using Android.App;
  3. using Android.Content.PM;
  4. using Android.OS;
  5. using Android.Views;
  6. using Android.Widget;
  7. using Microsoft.Xna.Framework;
  8. namespace Microsoft.Xna.Samples.MultiTouch
  9. {
  10. [Activity(
  11. Label = "MultiTouch",
  12. MainLauncher = true,
  13. Icon = "@drawable/icon",
  14. AlwaysRetainTaskState = true,
  15. LaunchMode = LaunchMode.SingleInstance,
  16. ScreenOrientation = ScreenOrientation.FullUser,
  17. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize | ConfigChanges.ScreenLayout)]
  18. public class Activity1 : AndroidGameActivity
  19. {
  20. private Game1 _game;
  21. protected override void OnCreate(Bundle bundle)
  22. {
  23. base.OnCreate(bundle);
  24. _game = new Game1();
  25. var frameLayout = new FrameLayout(this);
  26. frameLayout.AddView((View)_game.Services.GetService(typeof(View)));
  27. SetContentView(frameLayout);
  28. _game.Run();
  29. }
  30. }
  31. }