I have a listview and I want that by pressing and holding an item for a few seconds a dialog with several options is displayed, someone could advise me as this type of event is called. Thanks.
I have a listview and I want that by pressing and holding an item for a few seconds a dialog with several options is displayed, someone could advise me as this type of event is called. Thanks.
To detect a long pulse on an element, a listener setOnLongClickListener
must be launched on the element, to capture the event onLongClick
.
tv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
//Pulsación larga
return false;
}
});