konklone / congress-android

Congress for Android, an app for tracking Congress.
https://play.google.com/store/apps/details?id=com.sunlightlabs.android.congress
Other
157 stars 42 forks source link

replace one AsyncTask with AsyncTaskLoader #645

Closed yulin2 closed 7 years ago

yulin2 commented 9 years ago

Hello, I'm doing research on Android async programming. 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). Android docs recommend AsyncTaskLoader, which avoid the problems in AsyncTask.

I try to replace one AsyncTask with AsyncTaskLoader in congress-android in this pr (you don't have to merge). Do you think AsyncTaskLoader will work better for congress-android? Do you want to replace all AsyncTask to AsyncTaskLoader?

konklone commented 9 years ago

I don't mean to speak for Sunlight, but the app seems to be in a development hiatus (last commit to master was May 14, 2014). Offhand, this looks like a good step forward, but I would want to test it a bit and observe the difference in behavior if possible. I wasn't aware of the problems with AsyncTask, but that article was very helpful and explains some of the behavior I observed when I was developing this application.