Reputation: 177
I am using note app in today On that app if I delete any notes it will automatically do second note to be first position. And I also want to do this in my app
How is this possible ? I browsed in internet like this question but i have only little knowledge about this topic. Help me how to do this.
Upvotes: 0
Views: 378
Reputation: 116
So basically what the note app is using is a RecyclerView whose layout is in form of a Grid. When you delete the note, it automatically updates to the note below the deleted one because of a mechanism known as notifyItemRemoved() which basically takes the position of the adapter and removes it from the position it held. on the details of how to implement it in your project you can look up this previous answer here . hope this gives you a little clarification of the beauty of android development
Upvotes: 1