画新的东西之前需要先清除画布内容:
方法1:
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
方法2
Paint paint = new Paint();
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
canvas.drawPaint(paint);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));