Initialize a property with findViewById

Report a typo

You have declared a layout activity_main.xml that contains a TextView with an ID of userNameTextView. Declare a field named userNameTextView and initialize it with the view just mentioned.

Note that the provided code is a fake – it is not an actual Android code. It is only provided for completing the task, there are no Android dependencies available.

Write a program in Kotlin
class MainActivity : FakeActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
___

Create a free account to access the full topic