Java tutorial
//package com.java2s; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; public class Main { public static Drawable createRoundRectShape(int corner, int color) { GradientDrawable drawable = new GradientDrawable(); drawable.setCornerRadius(corner); drawable.setColor(color); return drawable; } }