I can't change the value of an initialised variable.
I tried googling the problem to no avail. Float is a primitive type so it cannot be lateinit.
class RegistrationActivity : AppCompatActivity() {
val scale = 0f
public override fun onStart() {
super.onStart()
scale = this.resources.displayMetrics.density
}
}
I expect to be able to initialise the "scale" variable outside of a method body so that it can be used by other methods, but in my attempt I'm met with the "Val cannot be reassigned" as an error inside of the "onStart()" method when I hover over "scale" in "scale = this.resources.displayMetrics.density".