There is a Фрагмент А , which dynamically forms its presentation. This fragment in the process of work may be temporarily replaced by Фрагментом Б Is it possible to somehow completely save Фрагмент А and its presentation instead of re-creating the fragment and its presentation when returning to it? The whole point of this is to preserve the dynamically created representation of Фрагмента A until it returns to the screen.

    1 answer 1

    Yes, it is possible.

    For example, the transition from fragment A to fragment B can be accomplished not through the replace(...) method of the FragmentTransaction class, but by adding add(...) fragment B and then hiding ( hide() ) fragment A and displaying the show() fragment B. And the transition from fragment B to fragment A to do the same through hide()/show() .

    • Thanks for the help, everything works. - Alexander Gima Nov.