@Override public void onDestroy() { super.onDestroy(); if (mArtTask != null) { mArtTask.cancel(true); mArtTask = null; } if (mTraktTask != null) { mTraktTask.cancel(true); mTraktTask = null; } }
protected void onLoadImage(String imagePath, FrameLayout container) { if (mArtTask == null || mArtTask.getStatus() == AsyncTask.Status.FINISHED) { mArtTask = new FetchArtTask(imagePath, container, getActivity()); AndroidUtils.executeAsyncTask(mArtTask, new Void[] {null}); } }