What is the appropriate replacement of deprecated getSupportLoaderManager()?

fabi picture fabi · Jul 18, 2018 · Viewed 20.2k times · Source

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

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

What should be an alternative to that call? Or can I still use getSupportLoaderManager without worrying?

Answer

amos godwin picture amos godwin · Mar 13, 2019

I also had this issue too and this code solved it for me LoaderManager.getInstance(this).initLoader(0,null,mRecipeLoaderManager);

i hope it helps