Scenario : Passing intent from Activity A to B, Now getIntent().getExtras() will return the value you are passed. In this way when we tap on the back button we select the first activity on the activity stack, in our case the home. Use one activity, which displays two fragments for tablets and on handset devices. Fragment Backstack. Android devices have a hardware ... on Handling back button press Inside Fragments ... fragment inside the activity by popping the backstack? Simply stated and per the Android ... (not unlike how the back button removes an Activity). The Real Best Practices to Save/Restore Activity's and Fragment's state. Created by Steve Pomeroy, modified to remove the activity lifecycle, shared under the CC BY-SA 4.0 license. Well the behaviour described above is normal because the back button acts at activity level not at the fragment level. I tried this, but it doesn't work: SupportFragmentManager.PopBackStackImmediate (null,PopBackStackFlags.Inclusive ); This is how I did it: So our activity is the same while we replace fragments as the user interacts with the app. Change language programmatically in android, change locale of your application on the fly. Use one activity, which displays two fragments for tablets and on handset devices. I developed a skeleton for simple apps, with the idea of a single activity which can be accessed by its fragments to start other fragments. Created by Steve Pomeroy, modified to remove the activity lifecycle, shared under the CC BY-SA 4.0 license. Change language programmatically in android, change locale of your application on the fly. Tutorial For Android: Android Fragment transaction: FragmentManager and Backstack, Check It Out Now! As it is possible to dynamically add and remove fragments from an activity. I want to clear the backstack. Programmatically Working with Android Fragments. The official android documentation seems intuitive but when I implement an app with a more complicated workflow, the fragments backstack gets messy and weird stuff starts happening.