Architecture-components-samples: Navigation, Saving fragment state(Feature Request)

Created on 11 Mar 2020  路  1Comment  路  Source: android/architecture-components-samples

Asking you to add possibility not to recreate fragment each time, for example - to add possibility mark fragment as "recreatable" to define which fragments should recreate and which shouldn't

related issue - https://github.com/android/architecture-components-samples/issues/530

Many developers waiting for this possibility, don't ignore please.

>All comments

Note that this is not the proper forum for feature requests - this is only for issues with the samples here (you'd want to file feature requests for libraries on the issue tracker).

First of all, Fragments aren't destroyed or recreated when on the back stack.

Fragments already save and restore their View state when on the back stack. If you have a Fragment that:
1) Saves and restores its state over configuration changes
2) Saves and restores its state over process death (i.e., when using 'Don't keep activities')

But doesn't save its state when on the back stack, file a bug against Fragments. If either case 1) or 2) fails, that's an issue with your Fragment that you need to fix first.

Was this page helpful?
0 / 5 - 0 ratings