I already asked this question but at that time I tought that the refresh time between to onTouch Events is my problem Android onTouch refresh rate . But it isn’t. So again my problem:
I need a Sprite moving left/right/up while my finger is touching the display. So my onTouchEvent return true. But this works only if my finger swipes a bit or if the touchscreen drivers are so worse that it jitters so much what is detected as finger movement.
I tought of a solution with Threads. So I start a Thread which is moving the player, which is interrupted when the finger is lifted. But maybe there is a better way to do that?
@Override
public boolean onTouchEvent(MotionEvent me) {
...
if (me.getY() < getHeight() / 2) {
return doAction(0);
} else if (me.getX() >= getWidth() / 2)
return doAction(2);
else if (me.getX() < getWidth() / 2)
return doAction(1);
//doAction returns TRUE
...
}
ok I managed it with Threads. Here is a part of doAction.