When a class extends another class, the initial class automatically has all the variables and methods defined in the extended class.
1. Add a new class named MyExtendedClass.
2. Import the needed import for your particular class to the imports section.
3. In your MainActivity.java file, add the below highlighted text to your public class.
public class MainActivity extends MyExtendedClass {
3. Compile and run!
Resources:
http://developer.android.com/reference/android/appwidget/AppWidgetProvider.html
http://xahlee.info/java-a-day/extend.html