50.7 Loading Scene 2
Before implementing the transition between the first and second scene it is first necessary to add some code to load the layout from the scene2_layout.xml file into a Scene instance. Remaining in the MainActivity.kt file, therefore, add this code as follows:
class MainActivity : AppCompatActivity() {
var scene1: Scene? = null
var scene2: Scene? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
scene1 = Scene.getSceneForLayout(rootContainer,
R.layout.scene1_layout, this)
...