ios - AIR for iOS nativeApplication.idleThreshold 仅适用于桌面?

标签 ios air

使用内置的 nativeApplication.idleThreshold 确定 AIR 应用程序的不活动状态。当我瞄准桌面时效果很好。但是,当我发布到 iOS 时无法让它工作。有谁知道为什么?

NativeApplication.nativeApplication.idleThreshold=4;
                NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;
                NativeApplication.nativeApplication.addEventListener(Event.USER_IDLE, function(event:Event) {
                    if (_mode != Const.IDLE) {
                        _mode=Const.IDLE;
                        sendNote();
                    }
                });
                NativeApplication.nativeApplication.addEventListener(Event.USER_PRESENT, function(event:Event) {
                });

最佳答案

它不起作用的原因是因为“设计”就是这样。

如果您查看“userIdle”或“userPresent”的文档,您会看到这一行: “此事件不会在移动设备或 AIR for TV 设备上调度”

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeApplication.html#event:userIdle

所以出于某种我无法理解的原因,他们认为没有必要在移动应用程序(iOS、Android、黑莓)中实现这两个事件。

但我认为它们在移动应用程序中也很有用,所以我提交了功能请求。

请在这里投票,以便他们考虑实现它: https://bugbase.adobe.com/index.cfm?event=bug&id=3648849

顺便说一句,在您的示例代码中,您使用的是 4 秒阈值,即使在桌面上也不起作用,因为最小值是 5 秒。

关于ios - AIR for iOS nativeApplication.idleThreshold 仅适用于桌面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18280831/

相关文章:

android - 在 Air/Android 应用程序上加载模块

ios - 创建要在选择器 View 中使用的数字数组不起作用

ios - 如何使用 PDFKit 突出显示 pdf 中选定的文本?

ios - 在iPhone上存储应用程序数据的最佳方法是什么?

ios - 如何在 Swift 中垂直(沿 y 轴)缩放 3D 对象?

ios - 如何在 TableView 中的行之间创建填充(间距)

flash - 使用 renderMode=GPU 的 iPad AIR 应用程序的性能突然下降

android - Android 版 Air : Black Screen after device-alarm

android - 屏幕旋转停止视频传输

keyboard-shortcuts - Adobe AIR 键盘 Hook