What is the simplest way to navigate from First Activity to Second Activity using Kotlin?
Is it possible not to use activity_main.xml
and activity_second.xml
files?
What is the simplest way to navigate from First Activity to Second Activity using Kotlin?
Is it possible not to use activity_main.xml
and activity_second.xml
files?
You can use this line of code in your first activity to open your second activity:
startActivity(Intent(this, SecondActivity::class.java)
It doesn't involve your xml views, although if you're using xml as your views, you should use setContent([your_xml_file])
method to tell your activity that where is their view.