Android Remove Fragment
I have a quick question, if I remove fragment A from the container and add
fragment B, is the state of fragment A lost?
I have my app where the user takes a picture (fragment A), I was then
hiding fragment A and showing or creating fragment B to allow the user to
review the image. On fragment B the user has the option to retake the
picture, in this case I was removing fragment B and showing fragment A.
The problem was that the camera preview wasn't being re-initialised so the
user wasn't getting the cam preview to take another pic. I remedied this
by removing fragment A from the container when the pic is taken.
The problem is I have many many fragments most of which I need to keep the
state of when navigating between, I know show and hide keep the state but
I don't want to have a 'special case scenario' where I have replace for
the fragment A and B and and show and hide for fragment C,D,E,F....
No comments:
Post a Comment