protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); weakActivity = new WeakReference <MainActivity>(this); CrashHandlerActivity.Register(this); Window.AddFlags(WindowManagerFlags.KeepScreenOn); try { Window.DecorView.SystemUiVisibility |= (StatusBarVisibility)(SystemUiFlags.LayoutStable | SystemUiFlags.LayoutFullscreen | SystemUiFlags.LayoutHideNavigation); Window.ClearFlags(WindowManagerFlags.TranslucentStatus); Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); if (Build.VERSION.SdkInt >= BuildVersionCodes.P) { Window.Attributes.LayoutInDisplayCutoutMode = LayoutInDisplayCutoutMode.ShortEdges; } } catch /*(Exception ex)*/ { #if !DEBUG throw; #endif } TryInit(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); CrashHandlerActivity.Register(this); Window.AddFlags(WindowManagerFlags.KeepScreenOn); try { View decorView = Window.DecorView; decorView.SystemUiVisibility |= (StatusBarVisibility)SystemUiFlags.LayoutStable; decorView.SystemUiVisibility |= (StatusBarVisibility)SystemUiFlags.LayoutFullscreen; decorView.SystemUiVisibility |= (StatusBarVisibility)SystemUiFlags.Immersive; //if ((int)Build.VERSION.SdkInt < 18) // RequestedOrientation = ScreenOrientation.SensorLandscape; Window.ClearFlags(WindowManagerFlags.TranslucentStatus); Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { Window.SetStatusBarColor(Color.Argb(0x22, 0x00, 0x00, 0x00)); } } catch /*(Exception ex)*/ { #if DEBUG throw; #endif } // Create our OpenGL view, and display it view = new GLView(this); SetContentView(view); }