0
0
Android Kotlinmobile~5 mins

Intent for activity navigation in Android Kotlin - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an Intent in Android development?
An Intent is a message object used to request an action from another app component, like starting a new screen (activity).
Click to reveal answer
beginner
How do you start a new activity using an Intent in Kotlin?
You create an Intent with the current context and the target activity class, then call startActivity(intent).
Click to reveal answer
intermediate
What is the purpose of the Context parameter when creating an Intent?
Context tells the Intent where it is starting from, usually the current activity or application environment.
Click to reveal answer
intermediate
How can you pass data to the new activity using an Intent?
Use intent.putExtra(key, value) to add data, which the new activity can retrieve from its intent.
Click to reveal answer
intermediate
What method do you use to retrieve data sent via Intent in the new activity?
Use intent.getStringExtra(key) or similar methods inside the new activity to get the passed data.
Click to reveal answer
Which class is used to start a new activity in Android?
AIntent
BActivityManager
CView
DService
What method starts the new activity after creating an Intent?
AlaunchActivity()
BstartActivity()
CbeginActivity()
DopenActivity()
How do you pass a string value "username" to the next activity?
Aintent.addData("username", value)
Bintent.setData("username", value)
Cintent.sendData("username", value)
Dintent.putExtra("username", value)
Which parameter is required first when creating an Intent to navigate?
ACurrent context
BBundle object
CIntent action string
DTarget activity class
How do you retrieve a string extra named "username" in the new activity?
Aintent.getData("username")
Bintent.getExtraString("username")
Cintent.getStringExtra("username")
Dintent.retrieveExtra("username")
Explain how to navigate from one activity to another using Intent in Android Kotlin.
Think about how you tell the app to open a new screen and share information.
You got /4 concepts.
    Describe the role of Context and Intent in activity navigation.
    Imagine Context as your current location and Intent as the invitation to go somewhere else.
    You got /4 concepts.