Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. public void onBindViewHolder(final TabFragment1.SimpleItemRecyclerViewAdapter.ViewHolder holder, int position) {
  2. holder.mItem = mValues.get(position);
  3. holder.mIdView.setText(mValues.get(position).title);
  4. holder.mContentView.setText(mValues.get(position).description);
  5.  
  6. if (holder.mThumbnail == null) {
  7. System.out.println("thumbnail null"); //NEVER gets called
  8. } else {
  9. if(mValues.get(position).thumbnailData!=null){
  10. System.out.println("thumbnailData contained"); //NEVER GETS CALLED, IT ALWAYS SEEMS TO BE NUL
  11. holder.mThumbnail.setImageDrawable(mValues.get(position).thumbnailData);
  12. } else {
  13. System.out.println("thumbnailData downloading"); //always happening
  14. try {
  15. AsyncTask<String, Void, Bitmap> execute = new DownloadImageTask((ImageView) holder.mThumbnail)
  16. .execute(holder.mItem.thumbnailUrl);
  17. mValues.get(position).thumbnailData = holder.mThumbnail.getDrawable();
  18.  
  19. if(mValues.get(position).thumbnailData!=null) {
  20. System.out.println("is null"); //hardly ever gets printed
  21. } else {
  22. System.out.println("is not null"); //always gets printed
  23. }
  24. } catch (Exception ex) {
  25. }
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement