Android - Persist a fragment across many activities
-
19-10-2022 - |
题
Let's say I have the following:
__________________
|Activity_Parent |
| | |
| | |
| | |
|Fragment_Container|
|Fragment_Footer |
|__________________|\
\
\________________________
| Activity_Child |
| | |
| | |
| | |
|Fragment_Child_Container |
|_________________________|
Where Activity_Parent hosts a container fragment (with several different screens), and a footer fragment I wish to persist across all activities so I do not waste time recreating it - it stays the same for the whole app.
The footer fragment is currently created in the Activity_Parent's onCreate().
When I finish the Activity_Parent and start the Activity_Child (which also recalls the onCreate() of it's parent), is there any way for me to not have to recreate the footer fragment?
I hope I'm clear - getting rather confused myself.
没有正确的解决方案
不隶属于 StackOverflow