https://kotlinlang.org logo
#compose
Title
# compose
b

brabo-hi

01/12/2022, 8:05 PM
Hi all, when inside a compose component, how could we listen to the activity event
override fun onNewIntent(intent: Intent?) {}
c

Colton Idle

01/12/2022, 8:10 PM
Compose doesn't change anything about activity methods like this that you still have to override as far as I know. Similar to how with compose, we still need to hook into onCreate to setContent.
b

brabo-hi

01/12/2022, 8:12 PM
what i am trying to do is to listen when for compose’s activity
newIntent
event
i

Ian Lake

01/12/2022, 8:14 PM
There's some upcoming work to make it possible for any component (including your composable) to listen for `onNewIntent()`: https://android-review.googlesource.com/c/platform/frameworks/support/+/1910162
But generally, you should just use the default launchMode
👍 2
2 Views