Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You don't show your whole <code>getView</code> function, so without knowing how you use the viewHandler, here's my take on what's going on:</p> <p>Your problem is that you're creating a new <code>CustomTarget</code> every time <code>getView</code> gets called. You are going against the point of having a <code>Target</code> object. Let me elaborate.</p> <p>When a new download request is made, previous requests to the same target get stopped or don't result in a call to the Target's callbacks. (so if the Target gets reused for a different row in a list it doesn't get both rows' images).</p> <p>You are using a new object for each request, effectively hinting Picasso that each request is for a different row so to speak. The doc says "<em>Instances of this interface will also be compared to determine if view recycling is occurring</em>", so since each request has a newly created <code>CustomTarget</code> object, no two requests will have the same object and a row recycle won't be detected.</p> <p>You're also using viewHolder. In this case I think the viewHolder should be extending the <code>Target</code> interface (if you only have 1 image per row). This way everytime you request a download you can use the same object and not create a new one.</p> <p>You're also delegating the implementation of your <code>CustomTarget</code> to the <code>ImageView</code>'s implementation. Make sure that ImageView's <code>equals</code> and <code>hashCode</code> functions fullfill the requirements Picasso asks for.</p> <p>Some info on how to implement <code>equals</code> and <code>hashCode</code>: <a href="https://stackoverflow.com/questions/27581/overriding-equals-and-hashcode-in-java">What issues should be considered when overriding equals and hashCode in Java?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload