Adding a Fragment with add() method doesn't hide previous fragments
问题 I'm experiencing "unexpected behaviour" when using add() method to add a new fragment. I want to add a new fragment on a FrameLayout, but when I do it the previous fragment stills visible. Is this the expected result when using add() method? It is because I am using a FrameLayout and add() method just place a fragment over the FrameLayout without affect the previous one? Thx 回答1: Not a bug. Try replace(..). instead adding to the back stack if required. EDIT I think that using replace or