What is the appropriate replacement of deprecated getSupportLoaderManager()?

前端 未结 6 2156
你的背包
你的背包 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:31

    As stated here: Loaders

    "Loaders have been deprecated as of Android P (API 28). The recommended option for dealing with loading data while handling the Activity and Fragment lifecycles is to use a combination of ViewModels and LiveData."

    Whenever you see something is deprecated, go directly to the developer api reference site and review the class or function for which you're looking and if there is an equivalent alternative.

提交回复
热议问题