I am playing with fragments in Android.
I know I can change a fragment by using the following code:
FragmentManager fragMgr = getSupportFragmentManag
If you are using the AndroidX Navigation:
AndroidX Navigation
val currentFragment = findNavController(R.id.your_navhost).?currentDestination
For more info on this navigation component: https://developer.android.com/guide/navigation/navigation-getting-started