Java tutorial
//package com.java2s; import android.graphics.drawable.GradientDrawable; public class Main { public static GradientDrawable getShape(float radius, int color) { GradientDrawable gd = new GradientDrawable(); // gd.setShape(GradientDrawable.OVAL); The larger the radius, the more round the radius gd.setCornerRadius(radius); gd.setColor(color); return gd; } }