In the Android documentation we have:
Note: Your implementation of these lifecycle methods must always call the superclass implementation before doing any work...
But I have seen cases where the code is placed after the superclass method, especially for methods like onPause(), onStop(), onDestroy(), for example:
@Override
protected void onPause() {
LocalBroadcastManager.getInstance(this).unregisterReceiver(mMessageReceiver);
super.onPause();
}
In both ways it works. So, what's the difference between putting the code before o after calling the superclass method? What's the correct way?