Someone proposed to implement something as this in the main Application class:
class MyApplication(someProp = SomeClass()): Application {
init {
... do some initializations
}
}
I have always used the OnCreate
method to perform all initializations of my application and I'm pretty confident that it is wrong to overload the constructor even if they are optional parameters; but I have a slight doubt that it may work.