aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-07-28 11:46:59 -0700
committerScott Jackson <daneren2005@gmail.com>2014-07-28 11:46:59 -0700
commit87e4567756c2f52f5ebd873c32740d5f06d8899b (patch)
tree39271e944e48a3218fcb54d78c09a2253fe8da94
parent24114e5fa36ede829664553525354395c1aaffe6 (diff)
downloaddsub-87e4567756c2f52f5ebd873c32740d5f06d8899b.tar.gz
dsub-87e4567756c2f52f5ebd873c32740d5f06d8899b.tar.bz2
dsub-87e4567756c2f52f5ebd873c32740d5f06d8899b.zip
#371 Automatically remove cancel imageTask if set
-rw-r--r--src/github/daneren2005/dsub/view/UpdateView.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java
index 9a04d911..9bcf5d08 100644
--- a/src/github/daneren2005/dsub/view/UpdateView.java
+++ b/src/github/daneren2005/dsub/view/UpdateView.java
@@ -33,6 +33,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.WeakHashMap;
+import github.daneren2005.dsub.util.ImageLoader;
import github.daneren2005.dsub.R;
public class UpdateView extends LinearLayout {
@@ -53,6 +54,7 @@ public class UpdateView extends LinearLayout {
protected boolean shaded = false;
protected boolean starred = false;
protected boolean isStarred = false;
+ protected ImageLoader.ImageTask imageTask = null;
protected final boolean autoUpdate;
@@ -85,6 +87,11 @@ public class UpdateView extends LinearLayout {
update();
}
public void setObject(Object obj1, Object obj2) {
+ if(imageTask != null) {
+ imageTask.cancel();
+ imageTask = null;
+ }
+
setObjectImpl(obj1, obj2);
backgroundHandler.post(new Runnable() {
@Override