title: Problems with Picasso and Recyclerview - Images get refreshed on scrolling but in the wrong imageviews
body: <p>I am working on a simple app where I search for a Tv show, where the app generates a GET request to TMDB. From there I am trying to display the images and details of results in a cardview. I am using Picasso for loading the images from TMDB and it works fine. The problem is when I scroll, the images loaded first get refreshed to the other imageviews instead of those show specific images.</p>
  
  <p>This is my asynctask code</p>
  
  <pre><code>class JsonTask extends AsyncTask&lt;String,String,String[][]&gt;{
      private List&lt;FeedItem&gt; persons;
      String [][] Finalarray = new String[200][3];
      @TargetApi(Build.VERSION_CODES.KITKAT)
      @Override
      protected String[][] doInBackground(String... params) {
          HttpURLConnection urlConnection = null;
          StringBuffer buffer = new StringBuffer();
          String line;
          BufferedReader reader = null;
          try{
              URL Request1 = new URL(params[0]);
              urlConnection = (HttpURLConnection) Request1.openConnection();
              urlConnection.setRequestProperty("Accept", "application/json");
              urlConnection.setRequestMethod("GET");
              urlConnection.setDoInput(true);
              urlConnection.connect();
              int responseCode = urlConnection.getResponseCode();
              Log.d("DEBUG_TAG", "The response code is: " + responseCode + " " + urlConnection.getResponseMessage());
              InputStream in = urlConnection.getInputStream();
              reader = new BufferedReader(new InputStreamReader(in));
              while ((line = reader.readLine())!=null){
                  Log.i("check","Line is"+line);
                  buffer.append(line);
              }
              String jsonobjectt= buffer.toString();
              JSONObject parentJson = new JSONObject(jsonobjectt);
              JSONArray parentArray = (JSONArray) parentJson.get("results");
              dataobtained=parentJson.getInt("total_results");
              for(int i = 0; i&lt;parentJson.getInt("total_results"); i++){
                  JSONObject temp = parentArray.getJSONObject(i);
                  Finalarray[i][0] = temp.getString("original_name");
                  Finalarray[i][1] = temp.getString("first_air_date");
                  Finalarray[i][2] = temp.getString("poster_path");
              }
          }
          catch (MalformedURLException e){
              Log.i("I do", "eee1");
              e.printStackTrace();
          } catch (IOException e) {
              Log.i("I do", "eee2");
              e.printStackTrace();
          } catch (JSONException e) {
              e.printStackTrace();
          } finally {
              Log.i("I do", "eee3");
              if(urlConnection!=null)
                  urlConnection.disconnect();
              try {
                  if(reader!=null)
                      reader.close();
              } catch (IOException e) {
                  Log.i("I do", "eee4");
                  e.printStackTrace();
              }
          }
          return Finalarray;
      }
  
      @Override
      protected void onPostExecute(String[][] result) {
          persons = new ArrayList&lt;&gt;();
          for(int i=0;i&lt;dataobtained;i++){
              //if(!result[i][0].isEmpty()&amp;&amp;result[i][2]!=null)
          persons.add(new FeedItem(result[i][0], result[i][1],"http://image.tmdb.org/t/p/w500"+result[i][2],searchpagee.this));
              }
          new Thread(new Runnable() {
              @Override
              public void run() {
  
              }
          }).start();
          mRecyclerView.setLayoutManager(llm);
          RVAdapter adapter = new RVAdapter(persons);
          mRecyclerView.setAdapter(adapter);
      }
  }
  }
  </code></pre>
  
  <p>And this is my Recycleradapter code</p>
  
  <pre><code>public class RVAdapter extends RecyclerView.Adapter&lt;RVAdapter.PersonViewHolder&gt;{
  
  List&lt;FeedItem&gt; persons;
  
  RVAdapter(List&lt;FeedItem&gt; persons){
      this.persons = persons;
  }
  public static class PersonViewHolder extends RecyclerView.ViewHolder {
      public static ImageView personPhoto;
      CardView cv;
      TextView personName;
      TextView personAge;
  
      PersonViewHolder(View itemView) {
          super(itemView);
          cv = (CardView)itemView.findViewById(R.id.cv);
          personName = (TextView)itemView.findViewById(R.id.titleCir);
          personAge = (TextView)itemView.findViewById(R.id.contentsCir);
          personPhoto = (ImageView)itemView.findViewById(R.id.person_photo);
      }
  }
  @Override
  public PersonViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.cardv, viewGroup, false);
      PersonViewHolder pvh = new PersonViewHolder(v);
      return pvh;
  }
  @Override
  public void onBindViewHolder(PersonViewHolder personViewHolder, int i) {
      personViewHolder.personName.setText(persons.get(i).title);
      personViewHolder.personAge.setText(persons.get(i).content);
      Picasso.with(persons.get(i).context).load(persons.get(i).photoId).placeholder(R.drawable.placeholder).fit().into(PersonViewHolder.personPhoto);
  }
  @Override
  public int getItemCount() {
      return persons == null ? 0 : persons.size();
  }
  </code></pre>
  
  <p>}</p>
  
  <p><a href="http://i.stack.imgur.com/fXlQ5.png" rel="nofollow">This is before scrolling</a>
  <a href="http://i.stack.imgur.com/AG79C.png" rel="nofollow">While scrolling. Images get repeated</a></p>