Say I want a dialog to .show() when the user Touches a certain element and .hide() once he releases it.
I found how to make the OnTouchListener. But is there any sort of OnReleaseListener?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thats actually included in the
OnTouchListener. It gives you a MotionEvent on the callback,use
MotionEvent.getAction()and check if it equalsMotionEvent.ACTION_UP. That means the user released the finger.Equally you can check for
ACTION_DOWNto differentiate the two.