How to disable screen timeout in NativeActivity

I am developing an application for NativeActivity (C / C ++ only).
I want to disable the screen timeout.

Do you know how to do this?

+4
source share
1 answer

If the OP is still looking for an answer or someone like me that finds this topic during the search, here is how you do it:

#include <android/window.h> [...] // place this in your init function once you have a valid window ANativeActivity_setWindowFlags(pYourAppStruct->activity, AWINDOW_FLAG_KEEP_SCREEN_ON, 0); 
+6
source

All Articles