Sometimes when I override methods, I get an exception the first time it's called like below:
05-31 21:32:04.266: E/AndroidRuntime(28471): android.support.v4.app.SuperNotCalledException:
Fragment AnalFragment{41795860 #1 id=0x7f070002} did not call through to super.onDestroy()
Why are we forced to call super.method()
? It makes sense that there are obligations by the parent class, but more importantly, how do we know that a method requires super
to be called, rather than waiting for it to crash?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…