I'm using List Picker with items stored in TinyDB. How can i create a button to delete some selected item?
Could you provide more information about your motivation for wanting to pursue this and what your ultimate goal is?
The easiest method is to offer the user a choice when an item in the listpicker is selected. You can use the notifier choose dialog for this. If they choose to delete, then remove the item from the underyling list, and reload the listpicker. It is often best to offer the user a confirmatory dialog before they delete the item (use another notifier choose dialog again for this).
Can u make a image with a example on App inventor's blocks?
There are two ways to make what you are saying.
In here, we have a textbox to write down your item, and then we'd have a save button to place it on the listveiwer. Now... onto your question about deleting, when we test it... the user would just have to click on his/her item that he/she has saved in the listveiwer.
- Sorry, I just saw @TIMAI2 with the other solution
If you want to use a button, you could do something like this:
will offer to delete the current listpicker selection
Deleting from a list picker is like washing the mirror instead of washing my face.
P.S. Here is a complete sample ...
You do not appear to have followed my blocks, this is probably why you get an error.
I have a code snippet on my website which also explains the 'danger' of deleting an item from a ListView:
https://www.professorcad.co.uk/appinventorsnippets#DelListViewItems
Guys i found a project on gallery that helped me. Thanks to everyone!