Shall I place commands before or after super.onDestroy() when overwriting an activity's ondestroy?
protected void onDestroy() {
//option 1: callback before or ...
super.onDestroy();
//option 2: callback after super.onDestroy();
}
(Now I fear: If super.onDestroy is too fast, it will never arrive in option 2.)
Anything that might be related to using the activity resources should be before the call to super.onDestroy()
. The code after it will b reached, but might cause problems if it needs those resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With