abc
abc

Reputation: 2027

What should I override onTouchEvent() or onTouchListener() in Android?

Hi in game programming in android where I draw things to the screen in a different thread using a SurfaceView, in order to receive touch events, should I override the onTouchEvent() method, or onTouchListener() from the View.onTouchListener interface?

Upvotes: 1

Views: 462

Answers (1)

Aron Lorincz
Aron Lorincz

Reputation: 1707

Well, it doesn't really matter, as both can do the same job. However overriding onTouchEvent results in more concise code, as you don't have to supply an implementation of a listener.

Upvotes: 1

Related Questions