5

I am developing app on NativeActivity(only C/C++).
I want to disable screen timeout.

Do you know how to do it?

4

1 回答 1

8

如果 OP 仍在寻找答案,或者像我这样在搜索时发现此主题的人,您可以这样做:

#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);
于 2013-03-29T10:23:36.903 回答