April 2019
Beginner to intermediate
698 pages
15h 15m
English
The first part of the Kotlin code that we need to change is to make sure that our new layout is displayed. We can do so by changing the call to the setContentView function in the onCreate function to look like this:
setContentView(R.layout.exploration_layout)
There are many import statements that are needed for this app, so let's add them all up front to save us from having to keep mentioning them as we proceed. Add the following import statements:
import androidx.appcompat.app.AppCompatActivity
import android.graphics.Color
import android.os.Bundle
import android.view.View
import android.widget.CompoundButton
import android.widget.RadioButton
import kotlinx.android.synthetic.main.exploration_layout.*
The preceding ...