Explain @override method?

0 Majid Yaseen · October 10, 2015
What is meant by @override method inside onCreate() method in android...? why it is used? if we don't use @overrid, then what it makes the difference?

Post a Reply


Oldest  Newest  Rating
0 Gary Whitney · October 10, 2015

Classes and interfaces can contain methods. Sometimes you don't want to use the method the way it is written and then you override the method.
When you implement an interface, you are agreeing to a "contract" that says you must implement the methods in the interface. Very often these methods are just a template. Then you override them in your code and give them your own functionality
The Blank activity assumes you want to use the menu capability  of the Action Bar.
Therefore it creates the mandatory methods that you  need to override.
However, the purpose of the tutorial is to  teach a concept that does not require the menus, so you are instructed to delete the overrides since the detract from the concept being presented.

Jump to tutorial # 33 if you want to see the menu overrides implemented.
0 Majid Yaseen · October 12, 2015
Thank you Gary Whitney!
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator