Android item long press Delete function

This can be written in the adapter

Generally, it will be called after writing

However, if it is written in this way, it will be deleted many times, which will be messy and not refreshed

So write it like this

PS: let's take a look at Android and long press to delete the item of listview

First, inherit onitemlongclicklistener

Then set permissions:

override method

Delete long clicked item

Dynamically update listview

The above is the Android item introduced to you by Xiaobian. Long press to delete it. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>