protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     o = new OrientationListener(this);
     if (o.CanDetectOrientation())
     {
         o.Enable();
     }
 }
        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)
        {
            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);
        }
Exemple #4
0
        protected override void OnResume()
        {
            base.OnResume();
            EventHelpers.Raise(this, Resumed, EventArgs.Empty);

            if (Game != null)
            {
                var deviceManager = (IGraphicsDeviceManager)Game.Services.GetService(typeof(IGraphicsDeviceManager));
                if (deviceManager == null)
                {
                    return;
                }
                ((GraphicsDeviceManager)deviceManager).ForceSetFullScreen();
                ((AndroidGameWindow)Game.Window).GameView.RequestFocus();
                if (_orientationListener.CanDetectOrientation())
                {
                    _orientationListener.Enable();
                }
            }
        }