How can i screen always on

How can i screen always on
0.0 0


my game is use accelometer
and no touch
so it will be dark and screen off

i want always screen on
and i found FLAG_KEEP_SCREEN_ON flag but i don’t know how to use it

help me


You can use the setKeepScreenOn() method or xml attribute with the android openGL view.

Within the HelloWorld Example you could modify the (found under android/src/org/cocos2dx/application/)

mGLView = (Cocos2dxGLSurfaceView) findViewById(;

// set the keep screen on flag

Or you could modify the layout.xml of your application and add the android:keepScreenOn to true for your OpenGL view.