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