Yes, this is considered bad practice. This is because if you start AsyncTask with BroadcastReceiver , Android can kill your process if onReceive() back and there are no active components active.
The correct way is to start the Service from BroadcastReceiver . And this Service should manage AsyncTask . Thus, Android will know about the active component, and Android will not kill it prematurely (unless other critical conditions arise, for example, insufficient memory).
inazaruk
source share