I have a program in which I would like to place an image at the coordinates of a touch event. I have the coordinates now I just need help with placing an image there. I will
To place a image at a certain coordinates you will have to draw the image on the canvas . To get the coordinates of the touch event use the following code:
@Override
public void onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_MOVE) {
mTouchX = event.getX();
mTouchY = event.getY();//stores touch event
} else {
mTouchX = -1;
mTouchY = -1;
}
super.onTouchEvent(event);
}