Since the Android getFragmentManager() API is deprecated, is there any alternative?

This method was deprecated in API level 28.

Use FragmentActivity.getSupportFragmentManager()


If I understood you well getFragmentManager() is now deprecated

we will use getChildFragmentManager() Return a private FragmentManager for placing and managing Fragments inside of this Fragment.

we will use getParentFragmentManager() Return the FragmentManager for interacting with fragments associated with this fragment's activity.

so, if you deal with fragments inside a fragment you will use the first one and if you deal with fragments inside an activity you will use the second one.

you can find them here package androidx.fragment.app;