glebpopoff / Hacker-News-Droid-App

Hacker News Android App Full Source
https://market.android.com/details?id=com.glebpopov.hackernews
35 stars 9 forks source link

Many comments get duplicated when you scroll back up #1

Closed suan closed 12 years ago

suan commented 12 years ago

@glebpopov says: The bug is in the CommentsFragment where Child Views are added to the parent view. When you scroll some of the child views get added twice for some reason.

suan commented 12 years ago

The issue is that getView() gets called multiple times when the screen is rendered. I tried some hacks around the existing code to prevent parents from adding children twice but it didn't work. I think we need to use the advice from here: http://blog.iangclifton.com/2011/05/22/simple-android-developer-mistakes/

glebpopoff commented 12 years ago

This should be resolved now. Please update and test. I completely re-implemented how comments get displayed. I no longer use ListView component, which was causing the issue (getView was reusing some of the components and causing grief)