What is the name of the event of pressing and holding an item in Android studio?

1

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.

    
asked by Andrey Herrera 05.07.2016 в 08:21
source

1 answer

0

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;
    }
});
    
answered by 05.07.2016 / 08:33
source