In Android, the Canvas class has a method called drawRoundRect() that you can use to draw rounded corners on the edges of a drawn rectangle.

I would like to emphasize that using a value of 1 for both 2nd and 3rd parameters will not give you rounded corners. At least use 3.

Here is a sample code

This code draws a black colored rectangle and fills it using the same color.

Related Posts Plugin for WordPress, Blogger...