Android蜂窝主页按钮杀死应用 [英] Android Honeycomb Home Button kills app

查看:109
本文介绍了Android蜂窝主页按钮杀死应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,你输入一些数据的应用程序。在pre-蜂窝行为如下:

I have an app where you enter some data. The PRE-Honeycomb behavior is the following:


  • 后退按钮似乎杀应用程序,所有输入数据丢失

  • 主页按钮似乎暂停应用程序,所有输入数据仍然存在应用程序下次启动后

有关蜂窝Home按钮的行为似乎已经改变。 pssing $ P $后的home键和启动应用程序再次输入的所有数据都将丢失。是intented?问题是,我可以覆盖后退按钮来保存数据,但阅读不同的岗位我不能覆盖的主页按钮。是可预期的行为或错误?如何处理呢?

For Honeycomb the behavior for the home button seems to have changed. After pressing the home button and start the app again all input data is lost. Is that intented? The problem is that I can override the back button to save data, but reading various posts I cannot override the home button. Is that an expected behavior or a bug? How to deal with it?

推荐答案

任何时候,您的应用程序是不可见的,它有资格被系统停止。你不应该假定一下,如果它被隐藏在后台您的应用程序仍在运行任何东西。如果要保证数据不丢失,请确保你的地方将它保存在的onPause(),又在 onResume()恢复它

Any time your app is not visible, it is eligible to be stopped by the system. You shouldn't assume anything about your app still running in the background if it's been hidden. If you want to guarantee data is not lost, make sure you save it somewhere in onPause() and restore it again in onResume().

这篇关于Android蜂窝主页按钮杀死应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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