将应用程序发送到后台并在下面的窗口中显示应用程序
我不希望我的应用程序在后台运行,我只想在我的应用程序收到内存警告时为用户提供关闭他/她的其他应用程序的选项。也就是说,我的应用程序显示带有“取消”和“确定”按钮的警报视图。如果他/她触摸“确定”,则会模拟按两次主页按钮。是否可以?
我在他们的设置中有这个选项,即他们是否想看到内存警告。我提到我不希望我的应用程序在后台运行,因为我看到这里提出了许多有关在后台运行自己的应用程序的问题。这与我的问题无关,我只是想澄清一下。
I dont want my app to run in background, I only want to give the user the option to close his/her other app(s) when my app gets a memory warning. That is, my app shows an alert view with Cancel and OK buttons. If s/he touches OK, then the twice push on the home button is simulated. Is it possible?
I have this as an option in their settings, i.e. if they want to see the memory warning or not. I mentioned that I don't want my app running in background, because I see many questions asked here about running their own app in background. It is not relevant to my question, I just wanted to make it clear.
不适用于公共 API。
除此之外,当您收到内存警告时,您应该只关心您分配和使用的资源,而不是要求其他人代替您释放内存。
Not with public APIs.
Beside that, when you receive a memory warning you should only take care of the resources you allocate and use, and not ask someone else to free memory instead of you.