I create a Kotlin-class with a class attribute, which I want to initialize in the constructor:
public class TestClass { private var context : Context? = nul
If the only thing you are doing in the constructor is an assignment, then you could use the Primary Constructor with a private Property.
e.g:
public class TestClass(private val context: Context) { public fun doSomeVoodoo() { val text = context.getString(R.string.abc_...) } }