How do I read data from an `rememberLauncherForAct...
# compose
j
How do I read data from an
rememberLauncherForActivityResult
?
Copy code
val dropInHintLauncher = rememberLauncherForActivityResult(
    contract = ActivityResultContracts.StartActivityForResult()
){ result: ActivityResult ->
    if (result.resultCode == Activity.RESULT_OK) {
        //  you will get result here in result.data
        val data = result.data
        print("wait here")
    }else{
        print("throw error popup")
    }
}
I feel like I need to cast this result.data some how?
Something like
Copy code
val data = result.data?.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT)
?
Copy code
val data: DropInResult? = result.data?.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT)
ftw