Android Listview row repeating item

会有一股神秘感。 提交于 2019-12-01 13:18:01

its because of this statement

if (playpos == position) {
        eq.setVisibility(View.VISIBLE);
    }

the listview recycles views so if you notice the first row and the last row is showing the same. That is because the first row was recycled to the last row

you can fix this by adding an else onto the if so it would look like

if (playpos == position) {
        eq.setVisibility(View.VISIBLE);
}else{
    eq.setVisibility(View.GONE);
}
Rahul Sharma

If you are extending BaseAdapter in you Adapter class then this solution will work. https://stackoverflow.com/a/28791031/4531507

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!