一段时间在我的Andr​​oid应用程序的原因不活动后返回摧毁一套价值观 [英] Returning after a period of inactivity in my Android Application causes destroy set Values

查看:176
本文介绍了一段时间在我的Andr​​oid应用程序的原因不活动后返回摧毁一套价值观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和我的应用程序的问题,当它进入的背景,然后 2-3分钟不活动的返回后回来,然后应用程序的开创建方法被称为和值设置为默认值,请帮我诊断此问题,并进一步应用包含了很多在它的声音和图像处理的,可能是这一事实引起的问题。谢谢

I have a Problem with my Application that when it goes to the background and then return back after 2-3 minutes of inactivity, then Application's on-Create method is called and values are set to the default values, kindly help me to diagnose this Problem and further Application contains a lot of sounds and image-processing in it, may be this fact causes an issue. Thanks

推荐答案

如果您没有保存的onSaveInstanceState中的应用价值(),他们不会提供给你的onCreate()。保存值的onSaveInstanceState(),你就能让他们回来的onCreate()。就这么简单。

If you did not save your application values in onSaveInstanceState(), they will not be available to you in onCreate(). Save your values in onSaveInstanceState(), and you will be able to get them back in onCreate(). It's as simple as that.

这篇关于一段时间在我的Andr​​oid应用程序的原因不活动后返回摧毁一套价值观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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