How do you select and delete a item of a List Picker?

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?

1 Like

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).

1 Like

Can u make a image with a example on App inventor's blocks?

1 Like

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.

  1. Sorry, I just saw @TIMAI2 with the other solution
1 Like

Sorry about the mess, but i really can't make it work. Can u help me?

If you want to use a button, you could do something like this:

will offer to delete the current listpicker selection

1 Like

Deleting from a list picker is like washing the mirror instead of washing my face.

P.S. Here is a complete sample ...

1 Like

I followed your blocks but still showing this error:
image

You do not appear to have followed my blocks, this is probably why you get an error.

1 Like

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

1 Like

Guys i found a project on gallery that helped me. Thanks to everyone!