Skip to content

Commit

Permalink
fix the asynctask thumnail loading
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Oct 1, 2015
1 parent 588fe70 commit 88311cd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class ViewHolder
View viewNote;
View viewTag;
View viewEncrypted;
AsyncTask<Integer, Void, Bitmap> loadTask;
}


Expand Down Expand Up @@ -272,10 +273,15 @@ public View getView(final int position, View convertView, ViewGroup parent) {
holder.checkBox.setChecked(false);
}

if (holder.loadTask != null)
holder.loadTask.cancel(true);

if (!m.hasThumbnail())
{

holder.imageView.setImageResource(R.drawable.ic_home_gallery);
new ThumbnailTask(holder,m).execute(128);
holder.loadTask = new ThumbnailTask(holder,m);
holder.loadTask.execute(128);
}
else
{
Expand Down

0 comments on commit 88311cd

Please sign in to comment.