The reason why this method is deprecated is because Loaders have been unbundled from their historical Fragment
and FragmentActivity
implementations in order to live in their own library that will soon be an optional dependency, and their implementation has been rewritten on top of architecture components.
The unbundled way of retrieving a LoaderManager
instance is to use the static factory method:
LoaderManager.getInstance(T)
where T
is an instance of both LifecycleOwner
and ViewModelStoreOwner
(the main implementations being FragmentActivity
and Fragment
).
ViewModel
andLiveData
. – Bigener