1
  public boolean onLongClick(View arg0) { 
         Toast.makeText(getContext(), "long click",
                         Toast.LENGTH_SHORT).show();
    return false;  }

    public void onClick(View arg0) { 
       Toast.makeText(getContext(), "click",
                    Toast.LENGTH_SHORT).show();
     }

If I return false in onLongClick() function, the onClick() function will be called.

But, while moving a finger over across the screen during the long press time, onClick() event not triggered when the finger goes outside the button in the screen. Does anyone know how to handle this case? I want to trigger an onClick() event when the finger goes outside the button in the screen.

Dr Mido
  • 2,414
  • 4
  • 32
  • 72
Shree
  • 43
  • 4

0 Answers0