1

I have a custom ImageView which starts a task to download an image from the web. What I exactly want for the task is to continue running while app is on current activity, even if the view is not present (for example in a scrolling gridview) which is how it is right now, but I also want to cancel the task if the user left the activity. Is there a particular method I can override for this? (something like onDestroy) or do I have to do it manually?

My custom view has a setImageUrl which starts the task for the url, other than that it's almost the same as ImageView.

4

1 回答 1

0

我不知道你是如何将你的任务实现到 downalod 的!但你可以使用 IntentService 或绑定到你的活动的本地服务,所以当你的活动完成时,你的任务将不再活动。

于 2013-08-12T08:17:56.497 回答