Android Question How to cancel image download task with Picasso?

susu

Well-Known Member
Licensed User
Longtime User
I made a simple app with 2 activities:
1. Main activity with a button to start LoadImage activity.
2. LoadImage activity has a scrollview with random 20 images (download from internet by using Picasso with JavaObject link).

It works fine but there's only one problem: From Main activity I click on button to start LoadImage activity, if I back to Main activity but the images still loading so it will auto open LoadImage activity again. How can I cancel the loading of images when LoadImage activity closed? I try to remove all ImageView and ScrollView in Sub Activity_Pause but it seems not work.

Thanks.
 

DonManfred

Expert
Licensed User
Longtime User
Can you post a smal project which shows the problem?
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
As Manfred has already said, a sample project would enable us to provide better help.
A method I have used in one of my Apps, and may work for you, is to set a Process Global Variable to abort the process. In my App this is checked in the JobDone event because it uses http. Maybe you could do something similar?
 
Upvote 0
Top