Code example for ImageView

Methods: invalidate

0
			downy = event.getY();
			break; 
		case MotionEvent.ACTION_MOVE:
			paint.setColor(Color.GREEN);
			canvas.drawRect(downx, downy, event.getX(), event.getY(), paint);
			imv.invalidate();
			break; 
		case MotionEvent.ACTION_UP:
			paint.setColor(Color.GREEN);
			upx = event.getX();
			upy = event.getY();
			canvas.drawRect(downx, downy, upx, upy, paint);
			imv.invalidate();
			break; 
		case MotionEvent.ACTION_CANCEL:
			break; 
		default: 
			break; 
		} 
		return true; 
	}