onTouchevent() vs onTouch()

stelios picture stelios · Feb 15, 2011 · Viewed 49.3k times · Source

After many experiments with onTouchEvent and onTouch, I found that onTouch works everywhere you want (whether it is in activity or view) as long as you have declared the interface and put the Listener right! On the other hand, onTouchEvent only works inside a View! Is my assumption correct? Is this the real difference?

Answer

trojanfoe picture trojanfoe · Feb 15, 2011

Yes you are correct - onTouch() is used by users of the View to get touch events while onTouchEvent() is used by derived classes of the View to get touch events.