Say, if I don’t call super.onPause in a override method from superclass Activity, I would get an error when onPause() is called. But errors don’t show up when I have no super.XXX calls in methods (onCreate, onStartCommand, …) of a class derived from Service.
So on what conditions should I call super.XXX in a override method?
The documentation tells you that you need to call
onPauseif you derive theActivityclass:The
Servicedocs don’t require that in theonStartCommanddocumentation.In general (not specifically in Android stuff), when you derive, you should call through to the superclass’s methods unless you know you shouldn’t. It’s a decision that needs to be case-by-case, but the default (I’d say) would be that you do it.