protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); o = new OrientationListener(this); if (o.CanDetectOrientation()) { o.Enable(); } }
protected override void OnDestroy() { UnregisterReceiver(screenReceiver); _orientationListener = null; if (Game != null) { Game.Dispose(); } Game = null; base.OnDestroy(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); o = new OrientationListener(this); if (o.CanDetectOrientation()) { o.Enable(); } RequestWindowFeature(WindowFeatures.NoTitle); }
/// <summary> /// OnCreate called when the activity is launched from cold or after the app /// has been killed due to a higher priority app needing the memory /// </summary> /// <param name='savedInstanceState'> /// Saved instance state. /// </param> protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(savedInstanceState); IntentFilter filter = new IntentFilter(); filter.AddAction(Intent.ActionScreenOff); filter.AddAction(Intent.ActionScreenOn); filter.AddAction(Intent.ActionUserPresent); screenReceiver = new ScreenReceiver(); RegisterReceiver(screenReceiver, filter); _orientationListener = new OrientationListener(this); Game.Activity = this; }
/// <summary> /// OnCreate called when the activity is launched from cold or after the app /// has been killed due to a higher priority app needing the memory /// </summary> /// <param name='savedInstanceState'> /// Saved instance state. /// </param> protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); o = new OrientationListener(this); if (o.CanDetectOrientation()) { o.Enable(); } IntentFilter filter = new IntentFilter(); filter.AddAction(Intent.ActionScreenOff); filter.AddAction(Intent.ActionScreenOn); filter.AddAction(Intent.ActionUserPresent); screenReceiver = new ScreenReceiver(); RegisterReceiver(screenReceiver, filter); RequestWindowFeature(WindowFeatures.NoTitle); }