Computer scienceMobileAndroidAndroid CoreData structures

Activity communication: returning data

Return a result

Report a typo

Complete the implementation of setResultAndFinish() by setting a result with the code RESULT_OK and creating an intent that includes an extra with the key Intent.EXTRA_TEXT holding the value returned from the getTextResult() function. Conclude the process by closing the activity.

You have access to the getTextResult() function in the given scope, and it's important to note that you are currently operating within an activity context.
Write a program in Kotlin
fun setResultAndFinish() {
// Write your code here

}

Create a free account to access the full topic