I have an imageview which displays an first image. I want to draw second smaller image on top of it. I am using canvas to draw the second image but it doesn't appears. Here I want to check if it's second touch on the imageview then let the second image be drawn. Thanks
iv2.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
float x = event.getX();
float y = event.getY();
int countClicked = countClicked + 1;
switch (action) {
case MotionEvent.ACTION_DOWN:
Canvas c = new Canvas(myBitmap);
c.drawBitmap(bm, 0, 0, null);
iv2.setImageBitmap(myBitmap);
if(countClicked == 2) {
c.drawBitmap(secondBitmap, x, y, p)
}
break;
return true;