How to check if a fragment is recovered from a stack?

Can I check if the Fragment restored from the stack? For example, if I had one, and then replaced by another and back to the previous one by pressing the android back button?

+6
android fragment
05 Oct 2018-11-11T00:
source share
1 answer

You need to have your back and keep an eye on it.

Take a look at this: http://adblogcat.com/fragment-transition-animations-while-hiding-the-previous-fragment/

The code contains its own stack of fragments and hides them instead of deleting them, giving it the same effect as the replacement (with backstack), except that it does not recreate the fragment every time, so the state of the fragment remains unchanged.

However, this code has a memory leak, and I should update it last, where fragments are not saved. Hope this helps.

0
Jul 31. '13 at 23:14
source share



All Articles