Skip to content

Support Android application lifecycle #3427

Closed

Description

@jimbeveridge

Android needs to be able to pause or kill a Flutter app based on memory pressure, then restore the app using a state bundle. Flutter apps needs to support this.

Activity

  1. abarth commented on Apr 21, 2016

    @abarth
    Contributor

    What kind of support are you looking for? You'd like to be able to save state to a bundle and then get that state back when restored? We've been thinking about using the PageStorage mechanism for this use case. If PageStorage persisted across Android killing and restoring the app, would that meet your needs?

  2. jimbeveridge commented on Apr 22, 2016

    @jimbeveridge
    ContributorAuthor

    My particular interest is that Android be able to kill the Dart VM to relieve memory pressure. This appears to need the Dart app being able to participate in the lifecycle so it can manage resource, which in turn requires some form of persistence. The persistence mechanism itself should probably be a separate issue.

    This bug is not an immediate need, more of a tracking bug as the project moves forward.

  3. abarth commented on Apr 22, 2016

    @abarth
    Contributor

    Android is able to kill the Dart VM just by killing the process that contains the Dart VM. There's nothing particular we need to do to enable that.

    The part we're missing is persisting enough state so that when Android restarts the app it comes back in a reasonable state.

  4. modified the milestone: on May 20, 2016
  5. modified the milestones: , on Jan 27, 2017
  6. Hixie commented on Oct 3, 2017

    @Hixie
    Contributor

    Closed as dupe of #6827. We do expose the lifecycle state now, we just don't automatically preserve state.

  7. github-actions commented on Aug 17, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityplatform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions