Received an intent

Report a typo

Assume that we have an app with two activities. To open the second activity from the first activity, the first activity uses an intent. The intent contains an extra of string type with the key Intent.EXTRA_TEXT.

The function getMessage() below is in the second activity and returns a nullable string. Finish implementing the function so that it returns the extra delivered to the second activity.

You have access to intent, the intent used to launch the activity. You can also access it using the getIntent() method.
Write a program in Kotlin
fun getMessage(): String? {
// Write your code below

}
___

Create a free account to access the full topic