Android development: OnTouchEvent
I'm using:
@Override
public boolean onTouchEvent(MotionEvent event) {
I'm using surfaceview.
But when I try:
if (event.getAction() == MotionEvent.ACTION_UP) {
Log.d("STATE: ", "Up");
It is never called. What is the reason?
It is really annoying, because I开发者_开发知识库 want my player to move when I hold down the screen.
Ensure you are returning true return true;
after you complete processing of the event (ACTION_UP in this case) and also returning super.onTouchEvent(event)
for every other event (i.e. the default)?
精彩评论