Delete item from list and database

Não consigo excluir os itens após o longclick na hora da listview, somente ele exclui do banco de dados, como poderia fazer?

I can’t delete the items after the longclick in the listview time, it only deletes from the database, how could I do it?

change clear tag tag listview.Selection index to selection

The algorithm is , first you need to clear the data from the list, clear the list view elements , and finally add the list elements to the list view…

Try like this


Upon long click, it will clear from tinyDB as well as from the list view… If you dont want to clear from tinydb then remove the TinyDB clear tag