To the best of my knowledge, AsyncTaskLoader
not only has all the capabilities of AsyncTask
but also incorporates best practices such as avoiding duplicate threads and premature death built-in.
Is there any justification for using AsyncTask
anymore, or should I always use AsyncTaskLoader
blindly? I ask this to determine if there is any exceptional scenario that I should be cautious about.
AsyncTaskLoader is only useful to load data in an Activity or Fragment. AsyncTask is more versatile and can do any kind of background operation in any kind of component. There are alternatives like RxJava, HandlerThreads, simple threads, etc. but it's certainly not deprecated.