2
votes

While working on an app for Android (in AS3, exported to Air 3.2), I noticed that even with my line of code that (should) keep the device awake was not working.

NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

I use this line in the constructor of my app, but the screen keeps dimming after about 60 seconds. Is there a way to prevent the app from dimming? The phone does not lock after my set time-out, so I suppose it is working partially.

1
Did you find out the answer to this? If so please post. I would love to know how to do this. Thanks - Papa De Beau

1 Answers

8
votes

My guess is you don't have adequate permissions. Make sure you have enabled these permissions in you app's XML file:

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