I am developing an Android Games. I have created a canvas on screen. I want to show an object for 2 second on its screen and then it should be disappear.
How can I achieve this?
I am developing an Android Games. I have created a canvas on screen. I want to show an object for 2 second on its screen and then it should be disappear.
How can I achieve this?
Use this code to remove your canvas object
Paint paint = new Paint();
paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
canvas.drawPaint(paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
else
Canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR)
Keep 2 copies of bitmap. On 2nd dont draw the object and draw this 2 bitmaps alternatively, or look into this will help you