According to which logic does super.onDestroy();
in destructors goes on top? For example:
protected void onDestroy() {
super.onDestroy();
releaseMediaPlayer();
}
and not:
protected void onDestroy() {
releaseMediaPlayer();
super.onDestroy();
}
Like in c++, obj-c, pascal, etc?
It really depends on what you want to do in your onDestroy
. This is what super.onDestroy does (in that order):
If the logic you put inside onDestroy
has something to do with those three things that android does, then you may have to worry about the order. Otherwise, and in most of the cases, it does not matter.