I'm totally new to Android (Java) Development and I'm so excited about it! The developers guide of Google is fantastic and I learned a lot in a small time. It even keeps me awake during the night ;)
Today I went through making menu's and there's something that I can't understand. It's about extending classes. The guide says:
Tip: If your application contains multiple activities and some of them provide the same Options Menu, consider creating an activity that implements nothing except the onCreateOptionsMenu() and onOptionsItemSelected() methods. Then extend this class for each activity that should share the same Options Menu. This way, you have to manage only one set of code for handling menu actions and each descendant class inherits the menu behaviors.
The point I don't get is how to extend a class... Let say I have a MainActivity and a SubActivity. I want to have the same menu in both activities so I make a MainMenuActivity. How do I extend this class for both activity's?
Yes I do searched on the net but couldn't find any usable. I really want to understand it so I hope anyone can help me out with some samplecode + explanation. Thank you in advance!!