android listview order changed when called notifyDataSetChanged

China☆狼群 提交于 2019-12-06 05:50:31

It's hard to tell what's going on without seeing the full source code for your adapter, but this sounds like an issue in your implementation of getView(). Every time getView() is invoked you must rebind all the data.

BackMountainBird

I've encountered a similiar problem here

I solved it by always creating a new ViewHolder in getView() implemantation.

So I think Romain Guy provide the correct way to solving such kinds of problems.

Hope it works.

It looks to me that in setEditText you are actually changing the list contents, so that might be a good place to start looking for issues.

i think instead of using private String[] mData;, You should use following,

private ArrayList mData = new ArrayList();
mData.add(item);

In my case, it works and does not change data, i hope you will solve your problem from this.

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