Android: reason to call superclass?

I am watching a Notepad tutorial from the Android developer site. I have a question about overridden functions that call a superclass of actions. For instance,

public class Notepadv3 extends ListActivity { ... @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, INSERT_ID, 0, R.string.menu_insert); return true; } } 

What is the meaning of super.onCreateOptionsMenu () ? I browsed the site and found the following explanation:

Call super.onCreateOptionsMenu (menu) to create the original menu items, then add new menu items using menu.add ().

But what original menu items are there?

Similarly, the point of another is super. (overridden_function) e.g. super.onCreateContextMenu ?

+4
source share
1 answer

The activity has a number of operations that they perform throughout their entire life cycle - some of them - cleaning the house (garbage collection), user interface material, etc.

As far as I know, super.onCreateContextMenu () does not need to be called, unlike methods like onCreate , onResume , etc.

+6
source

All Articles