Keeping the phone awake during tremble training

Keeping the phone awake during tremble training

Thank you!

<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>

Then you need to use this simple line of code anytime you want to keep the device awake:

NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

To enable the device to go to sleep again:

NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s