智能客服
你问我答,随时在线为你解决问题

























获取窗口实例对象后,调用setWindowKeepScreenOn方法可设置屏幕是否常亮。
- let isKeepScreenOn: boolean = true;
- let windowClass: window.Window = window.findWindow("test");
- try {
- windowClass.setWindowKeepScreenOn(isKeepScreenOn, (err: BusinessError) => {
- const errCode: number = err.code;
- if (errCode) {
- console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(err));
- return;
-
- }
- console.info('Succeeded in setting the screen to be always on.');
- });
- } catch (exception) {
- console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception));
- }
参考链接
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功