Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Order of statements in onDestroy() method

If 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?

like image 807
prepbgg Avatar asked Feb 03 '10 23:02

prepbgg


1 Answers

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.

like image 141
hackbod Avatar answered Sep 24 '22 18:09

hackbod