title: How to prevent Picasso from reloading images in RecyclerView?
body: <p>I am new to using both RecyclerView and Picasso.
  Essentially, what I'm trying to do is - Pass a list of tweets to the adapter. In the OnBind() method, I'm using Picasso to load an image onto each card(if it exists).
  When I scroll up and down, cards in which the image had been loaded previously flicker and reload the image. The text doesn't flicker. The flickering happens only in the case of images.</p>
  
  <p>I tried using setItemViewCacheSize(int size) on the recyclerview object. This function caches the specified number of items and gave me the smooth User experience which I was looking for. But I noticed that it resulted in an "outOfMemory" error.</p>
  
  <p>Is there something in the RecyclerView or Picasso documentation which I am missing out ?</p>
  
  <p>TweetsAdapter.java </p>
  
  <pre><code>package com.umangmathur.mynewtwitterclone;
  
  import android.content.Context;
  import android.support.v7.widget.RecyclerView;
  import android.support.v7.widget.RecyclerView.ViewHolder;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.TextView;
  import com.squareup.picasso.Picasso;
  import com.twitter.sdk.android.core.models.MediaEntity;
  import com.twitter.sdk.android.core.models.Tweet;
  import java.util.List;
  
  public class TweetsAdapter extends RecyclerView.Adapter&lt;TweetsAdapter.TweetHolder&gt; {
  
      private List&lt;Tweet&gt; tweetList;
  
      public TweetsAdapter(List&lt;Tweet&gt; tweetList) {
          this.tweetList = tweetList;
      }
  
      @Override
      public TweetHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          LayoutInflater inflater = LayoutInflater.from(parent.getContext());
          View view = inflater.inflate(R.layout.tweet_layout, parent, false);
          return new TweetHolder(view);
      }
  
      @Override
      public void onBindViewHolder(TweetHolder holder, int position) {
          Context context = holder.itemView.getContext();
          Tweet tweet = tweetList.get(position);
          holder.txtTweet.setText(tweet.text);
          List&lt;MediaEntity&gt; mediaEntityList = tweet.entities.media;
          if (mediaEntityList != null) {
              String mediaUrl = mediaEntityList.get(0).mediaUrl;
              Picasso.with(context).load(mediaUrl).into(holder.imgTweet);
          } else {
              holder.imgTweet.setImageDrawable(null);
          }
      }
  
      @Override
      public int getItemCount() {
          return tweetList.size();
      }
  
      public class TweetHolder extends ViewHolder {
  
          private TextView txtTweet;
          private ImageView imgTweet;
  
          public TweetHolder(View itemView) {
              super(itemView);
              this.txtTweet = (TextView) itemView.findViewById(R.id.tweetText);
              this.imgTweet = (ImageView) itemView.findViewById(R.id.imgTweet);
          }
      }
  
  }
  </code></pre>