Android, Is There An Onrelease Functions?
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 OnReleaseL
Solution 1:
onTouchListener
returns you a TouchEvent
object, which contains the current touch action, that can be retrieved by calling event.getAction()
. There are some actions, one of them are ACTION_DOWN
and ACTION_UP
: first tells you, that the user has touched some view, and second tells you that user has taken his finger off a view. Means onRelease
will be onTouch
with the ACTION_UP
action. Hope this helps.
Post a Comment for "Android, Is There An Onrelease Functions?"