Skip to content

Would like instructions on how to implement onSaveInstanceState #2004

Closed
@zoechi

Description

@zoechi

@eseidelGoogle commented on Fri Apr 20 2018

https://twitter.com/championswimmer/status/987327881960357889

My understanding is that FlutterView will handle the config change if AndroidManifest.xml contains:
android:configChanges="orientation|screenSize"
https://developer.android.com/guide/topics/resources/runtime-changes.html

But I'm not sure that we've written that down anywhere in our docs. I believe some of our sample are locked to portrait for historical reasons too?


@eseidelGoogle commented on Fri Apr 20 2018

I'm aware of at least one bug reported with Flutter's rotation code: flutter/flutter#16322 there may be others.


@championswimmer commented on Fri Apr 20 2018

There needs to be documentation regarding how onSaveInstanceState is to be implented in Flutter as well.


@championswimmer commented on Fri Apr 20 2018

Also pertinent : flutter/flutter#6827
And dupe: flutter/flutter#3427


@Sfshaza commented on Sat May 19 2018

Yes, added to doc content plan.


@Sfshaza commented on Thu May 31 2018

OK, PR #1037 handles documenting how to configure landscape view, and also that android should not restart a Flutter app.

The onSaveInstanceState doc is not yet written.


@mzgreen commented on Wed Jun 27 2018

Please note that onSaveInstanceState is not only about persisting state during config changes. More important part is that it's used it to persist transient app state when OS kills the app.
https://developer.android.com/topic/libraries/architecture/saving-states#system_initiated_ui_state_dismissal

Metadata

Metadata

Assignees

Labels

cl.fixedIssue is closed as fixede2-daysEffort: < 5 daysp1-highMajor but not urgent concern: Resolve in months. Update each month.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions