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

Task を downalod にどのように実装したかはわかりませんが、Activity にバインドする IntentService またはローカル サービスを使用できるため、Activity が終了すると、Task はアクティブではなくなります。

于 2013-08-12T08:17:56.497 に答える