【退出ANDROID应用程序AIR】赋料扬雄敌,诗看子建亲。这篇文章主要讲述退出ANDROID应用程序AIR相关的知识,希望能为你提供帮助。
For your Air for android application to properly close you need to define some handlers and respond to them.
- // Check if we are on a Android / iPhoney device.
- if( Capabilities.cpuArchitecture==" ARM" )
- {
- NativeApplication.nativeApplication.addEventListener( Event.ACTIVATE, handleActivate, false, 0, true) ;
- NativeApplication.nativeApplication.addEventListener( Event.DEACTIVATE, handleDeactivate, false, 0, true) ;
- NativeApplication.nativeApplication.addEventListener( KeyboardEvent.KEY_DOWN, handleKeys, false, 0, true) ;
- }
- private function handleActivate( event:Event) :void
- {
- NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
- }
- private function handleDeactivate( event:Event) :void
- {
- NativeApplication.nativeApplication.exit( ) ;
- }
- private function handleKeys( event:KeyboardEvent) :void
- {
- if( event.keyCode == Keyboard.BACK)
- NativeApplication.nativeApplication.exit( ) ;
- }
推荐阅读
- cisp401系列PayrollApp.java版本
- 禁用包含apple内容的网页=/
- 创建android项目
- 使用datamapper启动Rails项目
- Android pull解析器示例
- Android文本视图
- 允许在外部设备上安装android应用程序
- 使用launchdlaunch agents和launchctl,Apple Mac OSX Plist可实现更好的文件夹操作
- AppleScript-将文本从RGB转换为CMYK颜色值