In Android when you subclass the Application class is it best to intialise variables in the constructor or in onCreate? Or does it make no difference?
In Android when you subclass the Application class is it best to intialise variables
Share
You rarely implement a constructor on an Android component, such as an
ActivityorApplication. Inside ofonCreate(), after you have calledsuper.onCreate(), you can safely use most superclass methods. Hence, the typical pattern is to initialize anything complex inonCreate().