0

According to Android documentation, AsyncTaskLoader is deprecated in Android P. Can anyone tell me why they are deprecated and what alternative should we used instead?

EDIT - google now recommends using ViewModel instead of Loader that's the reason for their deprecation

Hitesh Bisht
  • 486
  • 1
  • 6
  • 11

1 Answers1

5

Can anyone tell me why they are deprecated

The framework implementation of Loader is deprecated, along with the framework implementation of Fragment.

what alternative should we used instead?

Use the Support Library edition of AsyncTaskLoader.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 5
    google now recommends using ViewModel instead of Loader that's the reason for their deprecation. – Hitesh Bisht May 16 '18 at 11:00
  • @HiteshBisht Where do you see it? I see that it's not deprecated yet: https://developer.android.com/reference/kotlin/androidx/loader/content/AsyncTaskLoader . – android developer Aug 03 '20 at 11:21