Note that there are some explanatory texts on larger screens.

plurals
  1. POListView Values are being duplictaed upon scrolling
    text
    copied!<p>I am using a listview s.t every row have an imageview and a flowlayout, I extended the baseadapter and I send it an arraylisy of hashmaps each one have the image path and a list of words my problem is every time I scroll up an entry "leaves" the screen and then down and the entry "comes back" to the screen the words in the entry flowlayout that gets recycled are being duplicated (meaning if the word next to a disk-on-key is "dok" then after I scroll down and then up again the word in the flowlayout is now "dok dok")...I cant figure out why... =(</p> <p>I took the flowlayout + bubbles to it from here - <a href="http://www.superliminal.com/sources/FlowLayout.java.html" rel="nofollow noreferrer">http://www.superliminal.com/sources/FlowLayout.java.html</a> <a href="http://nishantvnair.wordpress.com/2010/09/28/android-create-bubble-like-facebook/" rel="nofollow noreferrer">http://nishantvnair.wordpress.com/2010/09/28/android-create-bubble-like-facebook/</a></p> <p>and a decode async task to load images into the list from @MCeley's answer here - <a href="https://stackoverflow.com/questions/12414648/large-listview-containing-images-in-android">Large ListView containing images in Android</a></p> <p>and that is my getView code - </p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView = null; FlowLayout flowLayout = null; if (convertView == null) { convertView = layoutInflater.inflate(R.layout.list_item, null); imageView = (ImageView) convertView.findViewById(R.id.list_image); flowLayout = (FlowLayout) convertView.findViewById(R.id.flow_tags); } else { imageView = (ImageView) convertView.findViewById(R.id.list_image); flowLayout = (FlowLayout) convertView.findViewById(R.id.flow_tags); DecodeTask task = (DecodeTask) imageView.getTag(R.id.list_image); if (task != null) { task.cancel(true); } } HashMap&lt;String, List&lt;String&gt;&gt; photos = new HashMap&lt;String, List&lt;String&gt;&gt;(); photos = data.get(position); imageView.setImageBitmap(null); DecodeTask task = new DecodeTask(imageView); task.execute(photos.get(DatabaseHandler.KEY_PATH).get(0)); imageView.setTag(R.id.list_image, task); ArrayList&lt;String&gt; subjects = new ArrayList&lt;String&gt;(); int size = photos.get(DatabaseHandler.KEY_TAGS).size(); for (int i = 0; i &lt; size; i++) { String name = String.format("name - %s ", photos.get(DatabaseHandler.KEY_TAGS).get(i)); Bubble.getBubble(name, flowLayout, subjects, activity, photos.get(DatabaseHandler.KEY_PATH).get(0), false, false); } return convertView; } </code></pre> <p>TNX in advance..!</p>
 

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