I have a RecyclerView . I need to implement the removal, modification and addition of the item list (just TextView ). If everything is clear with the change - I just get and change the View , then how can I remove and add only one item without reloading the entire list?
|
1 answer
- Add / remove an item to / from the list (s) of data displayed by the adapter.
- Call
notifyItemInserted(int positionOfInsertedElement);/notifyItemRemoved(int positionOfRemovedElement);adapter method.
- oneAnd how to remove it \ add something?) - user189127
- oneUh-uh ... Well ... The documentation assures that for this there are methods
add&remove... The classes that implement theList... - JuriySPb ♦ - Does the
RecyclerViewimplement the sheet? O. About - user189127 - Not. But the data that you transfer to the adapter may well be. If you have an array, then everything is more complicated (and almost impossible for me) - YuriiSPb ♦
- oneOkay, create additional. project and figure it out. - user189127
|