A mobile developer wants to develop an app with two Activiti…
A mobile developer wants to develop an app with two Activities (FirstActivity and SecondActivity). There is a button in the first activity. When the button is clicked, the second activity is launched using the following code: val intent =Intent(this, SecondActivity::class.java) startActivity(intent)In the second activity, there is a button to go back to the first activity. The developer uses a very similar code in onClick event of this button to go back to the first activity. val intent =Intent(this, FirstActivity::class.java) startActivity(intent)What are the advantages or disadvantages of this implementation? If this implementation is not ideal, how would you accomplish described functionality above? (Describe at a high level, actual code is not necessary)
Read Details