Thread
#compose
    j

    Jason Inbody

    1 year ago
    How do I read data from an
    rememberLauncherForActivityResult
    ?
    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
    val data = result.data?.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT)
    ?
    val data: DropInResult? = result.data?.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT)
    ftw