1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00
MLEM/Demos.Android/Activity1.cs
2020-02-24 14:03:53 +01:00

29 lines
No EOL
1.1 KiB
C#

using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using MLEM.Misc;
namespace Demos.Android {
[Activity(Label = "Demos.Android"
, MainLauncher = true
, Icon = "@drawable/icon"
, Theme = "@style/Theme.Splash"
, AlwaysRetainTaskState = true
, LaunchMode = LaunchMode.SingleInstance
, ScreenOrientation = ScreenOrientation.UserLandscape
, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize)]
public class Activity1 : Microsoft.Xna.Framework.AndroidGameActivity {
protected override void OnCreate(Bundle bundle) {
base.OnCreate(bundle);
TextInputWrapper.Current = new TextInputWrapper.Mobile();
var g = new GameImpl();
// disable mouse handling for android to make emulator behavior more coherent
g.OnLoadContent += game => game.InputHandler.HandleMouse = false;
this.SetContentView((View) g.Services.GetService(typeof(View)));
g.Run();
}
}
}