Button click

Report a typo

Finish implementing the MainActivity class so that the performSearch() function is called when the searchBtn is clicked.

performSearch() is accessible in the current scope.
Write a program in Kotlin
class MainActivity : AppCompatActivity() {
// Do not change the line below!
lateinit var searchBtn: Button

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

searchBtn = findViewById(R.id.search_btn)
// Write your code here

}
}
___

Create a free account to access the full topic