When we redefine a method in a subclass, we call the superclass method in this method, for example:
protected void onSizeChanged(int w, int h, int oldw, int oldh) { width = w ; height = h ; Log.d(TAG, "onSizeChanged: width " + width + ", height "+ height); super.onSizeChanged(w, h, oldw, oldh); }
So why do we need to call super.onSizeChanged() ?
I delete the line super.onSizeChanged() and the result will be the same as with it.
Or the same in the onCreate method, we call super.onCreate() .
source share