开发者

Android: Order of statements in onDestroy() method

开发者 https://www.devze.com 2022-12-18 20:54 出处:网络
I开发者_如何学Gof I override my main Activity\'s onDestroy() method in order to recycle a bitmap when the screen is rotated, should I call super.onDestroy() before or after myBitmap.recycle()? Does it

I开发者_如何学Gof I override my main Activity's onDestroy() method in order to recycle a bitmap when the screen is rotated, should I call super.onDestroy() before or after myBitmap.recycle()? Does it matter?


Order does not matter. The base implementation of onDestroy() does nothing except make you you have called it. Some derived classes (such as ListActivity) may do something, but as long as you don't try to use any of their state after you call the derived class you will be fine.

0

精彩评论

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