Skip to content

Compose for Desktop doesn't emit lifecycle events, only states #4835

Closed
@SebastianAigner

Description

@SebastianAigner

1.6.10-rc03.

iOS:

Screenshot 2024-05-19 at 11 28 03

Desktop:

Screenshot 2024-05-19 at 11 28 27

Observed via:

@Composable
fun LifecycleLogger() {
    val lc = LocalLifecycleOwner.current
    LaunchedEffect(lc) {
        launch {
            lc.lifecycle.currentStateFlow.collect {
                println("New State: $it")
            }
        }
        launch {
            lc.lifecycle.eventFlow.collect {
                println("New Event: $it")
            }
        }
    }
}

Metadata

Metadata

Assignees

Labels

desktopquestionNot a bug, but question or comment

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions