OnActivityResult method is deprecated, you are looking for an alternative? Here It is the Latest Solution in android | Kotlin
One of the most used method OnActivityResult is deprecated in android. Here it is the alternative solution you can follow- People photo created by pressfoto - www.freepik.com In First Activity, take val resultLauncher using below code- private val resultLauncher = registerForActivityResult(StartActivityForResult()) { result -> if (result.resultCode == Activity.RESULT_OK) { try { val data: Intent? = result.data val stringResponse = data?.getStringExtra( "response" )!! } catch (e: Exception) { e.printStackTrace() } } } Now Call this val, where you want to make startActivityFor Result override fun onCreate (savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) button...