Wednesday, 4 May 2016

Difference between Add and replace fragment


replace removes the existing fragment and adds a new fragment..
but add retains the existing fragments and adds a new fragment that means existing fragment will be active and they wont be in 'paused' state hence when a back button is pressed onCreateView()is not called for the existing fragment(the fragment which was there before new fragment was added).

No comments:

Post a Comment