I've the fragments A -> B -> C -> D. Every fragment, with the method onCreateView
, change a String variable in the main Activity.
Everything works fine going from A to B or C or D, but when I press the back button - for example from C to B- I need to refresh the MainActivity's variable to the right value. How can I achieve that? onResume(), onStart(), onCreateView isn't called when I come back to previous fragments.
Edit, B C D is the same Class' fragment, and can be and fragments because I'm implementing a folder directory, with B C D sub folder directory. I cannot use tags I think, because I don't know how many fragments I have.