问题描述
在iOS的一个应用程序将收到一个内存警告通过实施一个名为 DidReceiveMemoryWarning
功能,这意味着内存不够用。如果2级版本的警告发出后,应用程序可能会停止生效。
In iOS an app will receive a memory warning by implementing a function called DidReceiveMemoryWarning
, which means the RAM is not enough to use. If a Level 2 version of this warning is sent, the app will probably be force stopped.
有没有类似的东西(如广播意图)在Android中告诉我的应用程序,我们出门在外的RAM和我可以编程方式删除某些对象?
Is there something similar (like a broadcast intent) in Android to tell my app that we're out of RAM and i could remove some objects programmatically?
感谢。
推荐答案
您应该通过扩展的类,并定义了应用程序标记,对象清单文件。在这个自定义对象可以覆盖onLowMemory()方法。
You should define your own custom application object by extending Android Application class and define that object in the Application tag in the manifest file. In this custom object you can override the onLowMemory() method.
希望这有助于你。
这篇关于iOS的内存警告Android的对手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!