FragmentTransaction : replace and addToBackStack not working together?
问题 I'm fairly new to Android development and now running in to weird behaviour. I have an empty FrameLayout to be the container of a fragment. If user press a button for the first time, generate new Fragment and put inside container. If user press a button later and there is existing fragment inside container, replace existing one with newly generated one. If user press back button, pop away the fragment inside container. Here is my code public void showFragment(View v) { FragmentA f = new