Skip to main content
deleted 14 characters in body
Source Link
georgehardcore
  • 1.1k
  • 16
  • 14

Clear backstack without loops

String backStackEntryNamename = getSupportFragmentManager().getBackStackEntryAt(0).getName(); getSupportFragmentManager().popBackStack(name, FragmentManager.POP_BACK_STACK_INCLUSIVE); 

Where name is the addToBackStack() parameter

getSupportFragmentManager().beginTransaction(). .replace(R.id.container, fragments.get(titleCode)) .addToBackStack(name) 

Clear backstack without loops

String backStackEntryName = getSupportFragmentManager().getBackStackEntryAt(0).getName(); getSupportFragmentManager().popBackStack(name, FragmentManager.POP_BACK_STACK_INCLUSIVE); 

Where name is the addToBackStack() parameter

getSupportFragmentManager().beginTransaction(). .replace(R.id.container, fragments.get(titleCode)) .addToBackStack(name) 

Clear backstack without loops

String name = getSupportFragmentManager().getBackStackEntryAt(0).getName(); getSupportFragmentManager().popBackStack(name, FragmentManager.POP_BACK_STACK_INCLUSIVE); 

Where name is the addToBackStack() parameter

getSupportFragmentManager().beginTransaction(). .replace(R.id.container, fragments.get(titleCode)) .addToBackStack(name) 
Source Link
georgehardcore
  • 1.1k
  • 16
  • 14

Clear backstack without loops

String backStackEntryName = getSupportFragmentManager().getBackStackEntryAt(0).getName(); getSupportFragmentManager().popBackStack(name, FragmentManager.POP_BACK_STACK_INCLUSIVE); 

Where name is the addToBackStack() parameter

getSupportFragmentManager().beginTransaction(). .replace(R.id.container, fragments.get(titleCode)) .addToBackStack(name)