开发者

How to properly implement onDestroy method?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜