What is the appropriate replacement of deprecated getSupportLoaderManager()?

前端 未结 6 2196
你的背包
你的背包 2020-12-08 07:46

I came to know that getSupportLoaderManager is deprecated. But I want to call:

getSupportLoaderManager().initLoader(0, null, mRecipeLoaderManager);
         


        
6条回答
  •  渐次进展
    2020-12-08 08:38

    Here you have a brief explanation on how to replace Loaders with ViewModel:

    https://developer.android.com/jetpack/arch/viewmodel#loaders

    The graphics there are self-explanatory, I think:

    For a more thorough explanation, you can read this blog post:

    https://medium.com/google-developers/lifecycle-aware-data-loading-with-android-architecture-components-f95484159de4

提交回复
热议问题