简体   繁体   English

如何在NativeActivity上禁用屏幕超时

[英]How to disable screen timeout on NativeActivity

I am developing app on NativeActivity(only C/C++). 我正在开发NativeActivity上的app(只有C / C ++)。
I want to disable screen timeout. 我想禁用屏幕超时。

Do you know how to do it? 你知道怎么做吗?

In case the OP is still looking for an answer or for anyone like me who finds topic this while searching, here's how you do it: 如果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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM