I notice a problem when reading “Hello, Android.”
When he implements the onCreate() in an Activity, it looks like:
{
super.onCreate(..);
...
...
}
But onSizeChanged() looks like:
{
...
...
super.onSizeChange();
}
And he doesn’t call super in onDraw().
Where should I put the super call statement? And where can I find answer in android’s document?
In any overridden method in a sub class, the location of super.methodname() is usually the first thing in that method, (like in
onCreate()). However, sometimes you need to do additional steps before calling super, so you do this as inonSizeChanged()method. The super call is determined by this criteria, not by any other rule.