I can't tell you the logic behind each of Google's changes, but per Google documentation at https://developer.android.com/topic/libraries/support-library/packages#v4-fragment:
The v13 support library provides a FragmentCompat class. The v4
Fragment class is a standalone class that provides bugfixes which were
added in later platform versions, whereas the v13 FragmentCompat class
provides compatibility shims for the framework implementation of the
Fragment class.
So to summarize you are basically getting bug fixes by using the support version.
At https://developer.android.com/reference/android/support/v4/app/Fragment it says:
The main differences when using this support version instead of the
framework version are:
- Your activity must extend FragmentActivity
- You must call getSupportFragmentManager() to get the FragmentManager
Using an online diff tool I can see the following differences in the API (not exhaustive) as of support library 28.0.0-alpha1 vs framework API level 28:
- In the support version
getActivity
returns a FragmentActivity
instead of an Activity
and the support version docs explain that the function may return null if the fragment is associated with a context
- Functions which operate on transitions such as
getReenterTransition
return Object
in the support version instead of ObjectTransition
- The support version added the following functions:
getLifecycle
, getViewModelStore
, onCreateAnimation
, requireActivity
, requireContext
, requireFragmentManager
, requireHost
- The
onInflate
method which takes an Activity
parameter is deprecated
I see no notable difference in FragmentManager
or FragmentTransaction
to speak of other than:
- In the support version
setAllowOptimization
is deprecated and the authors say setReorderingAllowed
is the replacement
To summarize the only major difference I see is that it appears that the support Fragment
need not be associated with an Activity
but the framework Fragment seems to require an associated Activity to function properly.