Vinod Baste
Jul 11, 2022

You may try this method

// Caller

val intent = Intent(context, Activity1::class.java)

getResult.launch(intent)

// Receiver

private val getResult =

registerForActivityResult(

ActivityResultContracts.StartActivityForResult()) {

if(it.resultCode == Activity.RESULT_OK){

val value = it.data?.getStringExtra("input")

}

}

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Vinod Baste
Vinod Baste

Written by Vinod Baste

just another writer with too many bugs.

Responses (1)

Write a response