title: Unable to load an image from an URL in a RecyclerView
body: <p>I can't seem to figure out why I haven't been able to load any sort of image (I've tried multiple URLs). I've tried using an AsyncTask class, and the issue still hasn't been resolved. My adapter class is listed below, any sort of help would be greatly appreciated.</p>
  
  <p>I'm trying to load an image (in this test case, the same image) for each RecyclerView entry. The default view (an orange square) appears when I don't attempt to set an image derived from URL, but if I do attempt it, the ImageView is simply left blank.</p>
  
  <p><strong>EntryAdapter</strong></p>
  
  <pre><code>public class EntryAdapter extends RecyclerView.Adapter&lt;EntryAdapter.EntryViewHolder&gt; {
  private Entry[] mDataset;
  
  // Provide a reference to the views for each data item
  // Complex data items may need more than one view per item, and
  // you provide access to all the views for a data item in a view holder
  public static class EntryViewHolder extends RecyclerView.ViewHolder {
      // each data item is just a string in this case
      public String source;
      public TextView textContent, title, label, author;
      public ImageView thumbnail;
      public CardView topCard, mainCard;
      public EntryViewHolder(View v) {
          super(v);
          title = v.findViewById(R.id.title);
          textContent = v.findViewById(R.id.textContent);
          topCard = v.findViewById(R.id.top_card);
          mainCard = v.findViewById(R.id.main_card);
          thumbnail = mainCard.findViewById(R.id.thumbnail);
          author = mainCard.findViewById(R.id.author);
          label = topCard.findViewById(R.id.label);
      }
  }
  
  // Provide a suitable constructor (depends on the kind of dataset)
  public EntryAdapter(Entry[] myDataset) {
      mDataset = myDataset;
  }
  
  // Create new views (invoked by the layout manager)
  @Override
  public EntryAdapter.EntryViewHolder onCreateViewHolder(ViewGroup parent,
                                                   int viewType) {
      // create a new view
      View v = LayoutInflater.from(parent.getContext())
              .inflate(R.layout.entry_item_constraints, parent, false);
  
      EntryViewHolder vh = new EntryViewHolder(v);
      return vh;
  }
  
  // Replace the contents of a view (invoked by the layout manager)
  @Override
  public void onBindViewHolder(EntryViewHolder holder, int position) {
      // - get element from your dataset at this position
      // - replace the contents of the view with that element
      holder.title.setText(mDataset[position].getTitle());
      holder.label.setText(mDataset[position].getLabel());
      holder.textContent.setText(mDataset[position].getTextContent());
      holder.thumbnail.setImageDrawable(LoadImageFromWebOperations(mDataset[position].getThumbnail()));
      holder.author.setText(mDataset[position].getAuthor());
  
      //new DownloadImageTask(holder.thumbnail).execute(mDataset[position].getThumbnail());
  }
  
  // Return the size of your dataset (invoked by the layout manager)
  @Override
  public int getItemCount() {
      return mDataset.length;
  }
  
  public static Drawable LoadImageFromWebOperations(String url) {
      try {
          InputStream is = (InputStream) new URL(url).getContent();
          Drawable d = Drawable.createFromStream(is, "reddit_thumbnail");
          return d;
      } catch (Exception e) {
          return null;
      }
  }
  }
  </code></pre>