Created
August 15, 2016 02:46
-
-
Save hatsunea/39e69507f3f7f977b6515a08a32048de to your computer and use it in GitHub Desktop.
Xamarin.Forms (Android) でスリープ状態にさせないためには
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity | |
{ | |
protected override void OnCreate(Bundle bundle) | |
{ | |
base.OnCreate(bundle); | |
global::Xamarin.Forms.Forms.Init(this, bundle); | |
LoadApplication(new App()); | |
// スクリーンオフやロックスクリーン回避 | |
Window.AddFlags(Android.Views.WindowManagerFlags.KeepScreenOn | | |
Android.Views.WindowManagerFlags.DismissKeyguard | | |
Android.Views.WindowManagerFlags.ShowWhenLocked | | |
Android.Views.WindowManagerFlags.TurnScreenOn); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment