Complete the code to create an Intent to start SecondActivity.
val intent = Intent(this, [1]::class.java) startActivity(intent)
You create an Intent specifying the current context and the target activity class. Here, SecondActivity is the destination.
Complete the code to put a string extra named "username" into the Intent.
intent.putExtra("username", [1])
The second argument to putExtra is the variable holding the string value you want to send. Here, userName is the variable.
Fix the error in retrieving the string extra named "username" from the Intent.
val user = intent.[1]("username")
To get a string extra from an Intent, use getStringExtra with the key name.
Fill both blanks to safely retrieve an integer extra named "age" with a default value of 0.
val age = intent.[1]("age", [2])
Use getIntExtra with the key and a default value to safely get an integer extra.
Fill all three blanks to create an Intent, put a boolean extra "isAdmin", and start the activity.
val intent = Intent(this, [1]::class.java) intent.[2]("isAdmin", [3]) startActivity(intent)
Create an Intent for AdminActivity, add a boolean extra with putExtra, and start the activity.