Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Convert AsyncTasks to IntentService #793
We discussed with some Android experts and they agree with this issue, and claim that AsyncTask can be considered only for short tasks (less than 1 second). However, using IntentService (or AsyncTaskLoader) can avoid such problems since their lifecycles are independent from
I refactored 8 AsyncTasks in
Wouldn't it be a lot easier to just use AsyncTaskLoaders?
To be honest, I haven't really dug deep into your proposal, but what I examined so far appears to be a lot more complicated that it needs to be.
By the way, most of our tasks read or write data from the database and should finish well under 100ms.
I agree either IntentService or AsyncTaskLoader makes the code more complex. So I didn't say
I sent this pr because I'm wondering in
Interesting stuff. Their example in README also shows a leak in AsyncTask:)
For short tasks, AsyncTask should be fine since the leak (if any) does not last very long.