Hey guys, how would you handle listening for `and...
# compose
f
Hey guys, how would you handle listening for
android.intent.action.SEND
With compose navigation component? I want to open a nested navigation destination that accepts a uri which is basically a string encoded when passing the argument and decoding when reading it, displaying an image from that uri, simple as that.
Copy code
DisposableEffect(Unit) {
    val listener = Consumer<Intent> {
        // logic here
        checkForRedirections(navHostController)
    }
    addOnNewIntentListener(listener)
    onDispose { removeOnNewIntentListener(listener) }
}
This is called, but most of the time the intent is
Copy code
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=xxxx/.MainActivity }
and only sometimes it’s
Copy code
Intent { act=android.intent.action.SEND typ=image/jpeg flg=0x10000001 cmp=xxxx/.MainActivity clip={image/jpeg {U(content)}} (has extras) }
Tried changing
launchMode
doesn’t work