touch - Android getting ACTION_UP without ACTION_DOWN -


hi want pass touch event parent, if touch has moved, when user clicks want handle within child, tried within child:

private boolean moved = false; @override public boolean ontouchevent(motionevent event) {     if (event.getaction() == motionevent.action_down) {         super.ontouchevent(event);         moved = false;         return false;     }     if (event.getaction() == motionevent.action_move) {         moved = true;         return false;     }     if (event.getaction() == motionevent.action_up) {         return !moved;     }     return true; } 

but when return false on action_down not action_up

on time action_down occours not know if handle or not

according this official android developer site link (read capturing touch events single view section)

beware of creating listener returns false action_down event. if this, listener not called subsequent action_move , action_up string of events. because action_down starting point touch events.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -