user2476221
user2476221

Reputation: 1

Android - Nested Fragments and exit animation

I have this issue where I have a Fragment A nested within another Fragment B. When I press back I want Fragment B to animate out while Fragment A is still visible. Currently, I am seeing that Fragment A is destroyed before Fragment B animates out. I have seen a solution where we take a bitmap of the screen and set that as the background of Fragment in its onDestroyView(). Are there other solutions to this issue aside from the one I just mentioned?

Upvotes: 0

Views: 587

Answers (1)

invertigo
invertigo

Reputation: 6438

Fragments inside fragments is a tricky task, and until recently was an unsupported practice (see Fragment Inside Fragment for more on that). Why not nest both your fragments in a single activity that way they can be managed independently?

Upvotes: 1

Related Questions