Created
August 20, 2015 13:25
-
-
Save devrath/c77827e602f0b5123cd4 to your computer and use it in GitHub Desktop.
Used to remove, add and clear the items in listview. all methods to be placed in adapter and accessed from activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void removeAt(int position) { | |
| items.remove(position); | |
| notifyItemRemoved(position); | |
| notifyItemRangeChanged(position, items.size()); | |
| } | |
| public void clearAll() { | |
| items.clear(); | |
| notifyDataSetChanged(); | |
| } | |
| public void addItem(Object itemss) { | |
| items.add(itemss); | |
| notifyItemInserted(items.size()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment