subsampling-scale-image-view
subsampling-scale-image-view copied to clipboard
AsyncTask is unsuitable and it would produce bug
There are some AsyncTasks In SubsamplingScaleImageView.java,and all tasks in background are not controlled, you can reproduce an bug by the following code snippet, eg.
scaleImageView.setImage(imageSource1); // the imageSource1 will take 30s to show completely scaleImageView.setImage(imageSource2); // this imageSource2 will take 2s to show completely
we expect to see imageSource2, but imageSource1 will be shown after 30s.
I suggest using rxjava instead of AsyncTask
I believe this can also be fixed by holding a set of ongoing AsyncTasks and cancelling all of them in methods like setImage() and recycle().