Is there any way that when using ft.addToBackStack(null); Are we adding only one instance to BackStack? Adding multiple instances of the same fragment to the Back Stack creates a mess when the user clicks the back button?
ft.addToBackStack(null);
You can try setting the string to the addToBackStack method. Ex
ft.addToBackStack("fragmentA");
Later, if you want to insert the same fragment again. You do this before adding it to the layout.
getFragmentManager().popBackStack("fragmentA", FragmentManager.POP_BACK_STACK_INCLUSIVE);
http://developer.android.com/reference/android/app/FragmentManager.html#popBackStack (java.lang.String, int)
Source: https://habr.com/ru/post/1481773/More articles:Appearance relay method is called in the user controller of the container - iosTask does not change parameters - closuresIs UIViewController beginAppearanceTransition: animated: method is available in iOS5 - iosJenkins and TestNG Results Encoding - encodinglpsolve package in R - rPHP pass a variable in LESS CSS or define the current environment in LESS - cssFault Drawing arcs between adjacent edges of a triangle - javaIn indexedDB, how can I tell if a record has been updated or inserted using objectStore.put? - indexeddbmoving array elements in c, is there a better option - performanceDownload dependent DLLs from Azure Blob - dynamicAll Articles