Napa Ram

    Napa Ram

    1 year ago
    is there a way to handle life cycle as we are not using fragment and only one activity is there is project, i need inform view model1. when compose screen created 2. when app go in background 3. when moving from one screen to another and when we are coming back to same screen 4. basically all lifecycle event
    Johan Reitan

    Johan Reitan

    1 year ago
    Alex

    Alex

    1 year ago
    Just do it in the activity and pass the values to the viewmodel, which then in turn can expose StateFlows to inform your composition
    Napa Ram

    Napa Ram

    1 year ago
    in my project there are around 15-20 module it will be difficult to handle everything in one activity a
    is compose not giving anything regarding lifecycle
    Johan Reitan

    Johan Reitan

    1 year ago
    Yes, you have the
    repeatOnLifecycle
    that’s explained in the linked post above. They even have an example with Compose at the end
    i

    Ian Lake

    1 year ago
    Michael Paus

    Michael Paus

    1 year ago
    I am wondering how the lifecycle handling concepts explained in the article will map to Compose Desktop where you are facing the same problem but don’t have all these Android specific APIs available. Or am I missing something here?