FragmentTransaction
Mahdi Tavakoli
FragmentTransaction is used for the simplicity of fragment transactions…
Static function in FragmentTransaction class :
- addFragment
- replaceFragment
- addFragmentWithAddToBackStack
- replaceFragmentWithAddToBackStack
Input arguments of functions :
- addFragment
addFragment(
fragment: Fragment,
supportFragmentManager: FragmentManager,
fragmentHolderId: Int
)
- replaceFragment
replaceFragment(
fragment: Fragment,
supportFragmentManager: FragmentManager,
fragmentHolderId: Int
)
- addFragmentWithAddToBackStack
addFragmentWithAddToBackStack(
fragment: Fragment,
supportFragmentManager: FragmentManager,
fragmentHolderId: Int,
backStackName: String? = null
)
- replaceFragmentWithAddToBackStack
replaceFragmentWithAddToBackStack(
fragment: Fragment,
supportFragmentManager: FragmentManager,
fragmentHolderId: Int,
backStackName: String? = null
)
Note: this functions is
static
Note: If you develop this class, send me a merge request to check Or you can email me.
[email protected]
Note: add androidx.fragment to dependency