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.
精彩评论