ushahidi / Ushahidi_Android

[Deprecated] Ushahidi Android app For Ushahidi V2.x.x. Working on V3.x.x at
https://github.com/ushahidi/platform-android/
GNU Lesser General Public License v3.0
202 stars 153 forks source link

choose between AsyncTask and IntentService/AsyncTaskLoader #178

Open yulin2 opened 9 years ago

yulin2 commented 9 years ago

Hello, I'm doing research on Android async programming. I see in Ushahidi_Android, you use IntentService at some places (SyncServices) while use AsyncTask at other places (such as GeocoderTask). I'm wondering how do you choose between AsyncTask and IntentService? because both are used to execute background tasks.

As far as I know, some articles (for example this article) mention that AsyncTask leads to memory leak and losing task result when there's a configuration change (such as orientation change). But using IntentService or AsyncTaskLoader can avoid such problems.