如何退出(或暂停)一个Flex 4.5 IPhone应用到code吗? [英] How do I exit (or suspend) a Flex 4.5 IPhone Application through code?

查看:197
本文介绍了如何退出(或暂停)一个Flex 4.5 IPhone应用到code吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NativeApplication.nativeApplication.exit()似乎并没有工作在IOS和我在一个位置,如果某个错误code是我想要么是能够关闭并重新启动我的应用程序了。

NativeApplication.nativeApplication.exit() does not seem to work on IOS and I'm in a position where if a certain error code is I'd like to either be able to shutdown and restart my applicaiton.

推荐答案

您不能(据我所知)退出的iPad应用,但你可能会崩溃吧!还有的绕了其他方法,但总的想法是继续服用更多的内存,直到的iOS强制应用程序退出。

You can't ( as far as I know ) exit an iPad application, but you can crash it! There's other ways of going about it, but the general idea is to keep taking more memory until iOs forces the app to quit.

function exitApp ( e:Event = null ):void {
    //NativeApplication.nativeApplication.exit();

    var crashingBitmaps:Array = []

    do {
        var bm:BitmapData = new BitmapData ( 2048, 2048, Math.floor( Math.random() * uint.MAX_VALUE ) );
        crashingBitmaps.push( bm );
    } while ( true );
}

随机颜色的填充可能是不必要的,但我得到迷信的时候。我有很多的iPad的亭机箱与家居按钮无法实际接触的工作,而这个小功能,只是让我的生活轻松了许多。希望它能帮助。

The random coloured fill is probably unnecessary, but I get superstitious sometimes. I work with lots of iPads in kiosk enclosures with the home buttons physically inaccessible, and this little function just made my life a lot easier. Hope it helps.

这篇关于如何退出(或暂停)一个Flex 4.5 IPhone应用到code吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆