I need to display a delete button on long press of a list item..
I've got the code for long press.. but don't know how to code for displaying a button inside this long press...
I need to display a delete button on long press of a list item..
I've got the code for long press.. but don't know how to code for displaying a button inside this long press...
You can use Alert dialog. Here is an example
Finally got the answer...
.xml file
.java file
First you have to make that delete button invisible using code, or setting it's property in xml file. When the user clicks on
longpress
you have to make that delete button visible. After the delete action is completed, make that button invisible again.