开发者

How to release resources on force close of activity

i am using camera resource in my activity some time activity does not respond and ask for force close how can we release o开发者_Python百科ur resources on force close of activity


You can't. Once Android needs to force close your app, it's already past the point where you can execute any code.

However, Android should release your resources for you so you shouldn't need to worry.


AFAIK there is a method called onLowMemory() that can be overridden in any class where you can access context parameter. But it is called only when your application is running out of memory and you can perform only those tasks which do not require extra memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜