- Home /
Screen dims when its not supposed to
I've created a game using the accelerometer of an Android device. The problem is that the screen will dim, and eventually the device will sleep after a while. I've tried the following solutions.
In Unity and C#:
Screen.sleepTimeout = 0;
Via plugin
UnityPlayer.currentActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
I've even tried using WakeLock even though many people have suggested against it. But nothing works!
The device is a Kindle Fire, and I'm building for 2.1 Eclair with ARMv6 and OpenGL ES 2.0
Does anyone know what I'm doing wrong?
Answer by michael100 · Dec 31, 2011 at 09:09 AM
Because you dont restart your Kindle Fire.
I don't understand your answer, I've tried to restart it, but should I tell all the people that have downloaded the game to restart their devices? That makes no sense. Btw, restarting the devices did not help.
Answer by DoktorAce · Jan 03, 2012 at 08:56 AM
Somehow this seems to work
iPhoneSettings.screenCanDarken = false;
I was under the impression that this was deprecated, but maybe I was wrong?