Reputation: 729
I have a listview and I am using list.add(mylist) and adapter.notifydatasetchanged() ,its adding the items below the existing list ,How Do I add the Items on Top of the List.
Eg: If I receive new msgs It should be on top of the existing list.
Thanks in Advance.
Upvotes: 3
Views: 8358
Reputation: 79
Actually, if you bind your adapter to your ListView, you can also just insert the item into your adapter with the position (in this case 0)
list.setAdapter(adapter);
...
adapter.insert(data, 0);
It shoudl update by itself because you had it bound
Upvotes: 4