use of org.qii.weiciyuan.support.lib.MyAsyncTask in project weiciyuan by qii.
the class GalleryActivity method onDestroy.
@Override
protected void onDestroy() {
super.onDestroy();
for (String url : urls) {
MyAsyncTask task = taskMap.get(url);
if (task != null) {
task.cancel(true);
}
}
if (pager != null && unRecycledViews != null) {
Utility.recycleViewGroupAndChildViews(pager, true);
for (ViewGroup viewGroup : unRecycledViews) {
Utility.recycleViewGroupAndChildViews(viewGroup, true);
}
System.gc();
}
}
use of org.qii.weiciyuan.support.lib.MyAsyncTask in project weiciyuan by qii.
the class AbstractAppListAdapter method interruptPicDownload.
protected void interruptPicDownload(GridLayout gridLayout) {
for (int i = 0; i < gridLayout.getChildCount(); i++) {
ImageView iv = (ImageView) gridLayout.getChildAt(i);
if (iv != null) {
Drawable drawable = iv.getDrawable();
if (drawable instanceof PictureBitmapDrawable) {
PictureBitmapDrawable downloadedDrawable = (PictureBitmapDrawable) drawable;
IPictureWorker worker = downloadedDrawable.getBitmapDownloaderTask();
if (worker != null) {
((MyAsyncTask) worker).cancel(true);
}
iv.setImageDrawable(null);
}
}
}
}
use of org.qii.weiciyuan.support.lib.MyAsyncTask in project weiciyuan by qii.
the class AbstractAppListAdapter method interruptPicDownload.
protected void interruptPicDownload(IWeiciyuanDrawable view) {
Drawable drawable = view.getImageView().getDrawable();
if (drawable instanceof PictureBitmapDrawable) {
PictureBitmapDrawable downloadedDrawable = (PictureBitmapDrawable) drawable;
IPictureWorker worker = downloadedDrawable.getBitmapDownloaderTask();
if (worker != null) {
((MyAsyncTask) worker).cancel(true);
}
}
view.getImageView().setImageDrawable(null);
}
Aggregations