Posts Why do items disappear when I scroll the listView?
Post
Cancel

Why do items disappear when I scroll the listView?

source - http://stackoverflow.com/a/6118581/1320686

It’s because you’re hiding some of your views sometimes, and you never show them again. Remember that views are recycled, so, unless you show the views the next time you return one, they will never be visible again.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//source - http://stackoverflow.com/a/6118581/1320686
//author - dmon
        if (!(datapark.get(position).bio.equals(""))){          
          holder.bio.setText(datapark.get(position).bio);
        }else{
          holder.bio.setVisibility(View.GONE);
        }

//instead try:

        if (!(datapark.get(position).bio.equals(""))){ 
          holder.bio.setVisibility(View.VISIBLE);         
          holder.bio.setText(datapark.get(position).bio);
        }else{
          holder.bio.setVisibility(View.GONE);
        }

origin - http://www.pipiscrew.com/?p=3930 android-why-do-items-disappear-when-i-scroll-the-listview

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags