I’m right now learning Kotlin for Android development coming from .NET C#. I have an issue regarding the Kotlin syntax, for example this:
val nameObserver = Observer<String> { newName ->
nameTextView.text = newName
}
This code is taken from Android LiveData Documentation. I think Observer is a new object, without the new keyword, as it does not exists in Kotlin. My problem is the lambda part. Is this a property that is initialized in the object ? How do I know which property is initialized without naming them , are they taken in order ? What is supposed to be newName in this context, the nameObserver value or something else ?
Sorry if this sounds like a dumb question, I’m just learning Kotlin. I know the answer is hidden somewhere in the Kotlin documentation, I just did not figured it out by reading the docs.