In very simple terms, lets say I have several fragments and on the UI, the user can click on any item which then selects one of the fragments. The user must be able to use the "back" key to get back to previous screen.
I tend to end up with these few lines of codes:
QUESTION: But doesn't the null in addToBackStack(null) mean it won't be added to the backstack?
I tend to end up with these few lines of codes:
Code:
FragmentTransaction ftx = getFragmentManager().beginTransaction();
ftx.replace(R.id.my_container_frame, fragment);
ftx.addToBackStack(null);
QUESTION: But doesn't the null in addToBackStack(null) mean it won't be added to the backstack?