Reputation: 693
I have a listview that is working fine. Now I have one option to enable and that is deleting the row. I know this is not a problem But Want to take some suggestions. and that is what is a best way of deleting the item(row). Here what I have tries I am sharing with you
What are prerequisites :
I am using fragments with one single activity and using tool bar so I really can use delete option appearing in toolbar for only one fragment . Actually I do not know how to do it.
So please tell me what are the good and best way which are user friendly , looks good in gui and also a Beginner developer friendly
Upvotes: 1
Views: 633
Reputation: 316
You can use Recyclerview instead of ListView. It has default animation while adding/removing items. You can check the code here or you can provide cross icon in the item and delete on click of it.
Upvotes: 0
Reputation: 3288
One solution is,
Add hidden checkbox in each listview row.
Add delete button on the toolbar/actionbar.
OnClicking delete button show checkboxes to select multiple items to delete.
Again clicking on delete should ask confirmation dialog and delete if user agrees.
Upvotes: 1