开发者

How to get only new items from the adapter?

I have some list and that I create adapter

Add adapter = new Add(this,R.layout.vieww, cursor, items);

Now when I change the items list, afren notifyDataSetChanged(), i get the reflected changes in the view, so far so good... But the thing I need is to get only the new item , only the items that开发者_如何学JAVA have been change

How can I do this ?


well just remove the old items from the items array which would be the simplest thing to do.

you can also sort the array by new items and change the adapter count to return just the count for new items.

but i don't know why a solution like that. it isn't really practical to even store items that you don't show. if you need them you can also have 2 arrays ( a new item array and an old item array). to the old one you can add all the items before you change the list and then just add a new array to the adapter containing only the new items.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜