In Activity's onCreate function, What is the purpose of super.oncreate() ?

Answer: It will create graphical window for sub class.

Description:
Every activity should inherit from Activity class.

Activity base class provides 3 basic functions for every screen:
1.It provides empty graphical window on which you can load your designed screen.
2.Activity Base Class will handle all the UI events which are not handled by programmer.
3.Activity Base Class will handle transition states of your activity, when you are moving from one activity to other activity.

super.onCreate:
When you call super.onCreate it will provide empty graphical window on which you can load your screen.
If you comment super.oncreate(); then it will crash your program because there is no container to load your screen.

 

No comments:

Post a Comment