开发者

How to properly implement onDestroy method?

开发者 https://www.devze.com 2023-04-03 10:15 出处:网络
I\'m developing an android application and i\'m almost done, and in order to have a good application i wanted to know how to properly 开发者_JAVA百科implement the onDestroy method, i mean do i have to

I'm developing an android application and i'm almost done, and in order to have a good application i wanted to know how to properly 开发者_JAVA百科implement the onDestroy method, i mean do i have to call the garbage collector or set everything to null?

thanks in advance..


If you have a database opened,or a opened cursor you can close them in onDestroy() method.System will automatically call gc when it is necessary.


On Destroy method you can set null all and System.gc() for garbage collector,,,,,Mind that its not neccesary to set null Because java has this feature to null object using garbage collector..........

0

精彩评论

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

关注公众号