Noobie to Kotlin here, so this may be a silly question…
I have an Android Activity that is passed a parameter “XYZ” on launch.
In the onCreate method of the Activity, I want to initialise a Member variable of the activity, passing the XYZ parameter to the constructor.
What is the best way to declare this member variable.
Kotlin doesn’t allow me to assign null to it, and I REALLY don’t want to make this member variable nullable. One of the reasons I like Kotlin is the fact that I can create classes that can’t ever be null.
How can I declare the member variable in the knowledge that it can’t be constructed until the onCreate of the Activity.