Hello, I am new in Kotlin.
I have searched a solution on the web before posting this topic bit did not find one.
I want to to set a global val variable (vDataFile) at startup that I want use in any function in the MainActivity class but the program crashes when reaching that second line. Could anyone tell me what is wrong?
class MainActivity : AppCompatActivity() {
val vDataFile = File(applicationContext.filesDir, “data.txt”)
override fun …
THANKS