As i said earlier that is much declarative answer to help you here.You need to share your code here to help something.
I would like to give you some hint to do this: override onTouchEvent(MotionEvent event)
method. Use event.getAction()
to catch various MotionEvent
. When you can identify MotionEvent.ACTION_DOWN
then set event.getX()
and getY()
as your objects current x,y. That will stop moving your object.
Similarly, at MotionEvent.ACTION_UP
update your objects position(x,y according to the direction), and set yourObject.setTouched(false)
. So when user release his finger from the screen object will start to move again.