I want to build an app which animates a circle completing from 0 to 360 in android. I am new in android and working on animation
Paint paint = new Paint();
paint.setColor(Color.BLACK);
paint.setStrokeWidth(5);
paint.setStyle(Paint.Style.STROKE);
Path path = new Path();
float center_x, center_y;
center_x = width/2;
center_y = height/2;
final RectF oval = new RectF();
oval.set(center_x - radius,center_y - radius,center_x + radius,center_y + radius);
path.addArc(oval, 0, 360);// like this line produce a complete circle but i want animation which start from 0 and end at 360
canvas.drawPath(path, paint);
I try to use while loop with invalidate(); but it did not work. So please help me.