I\'m trying to create a background for my LinearLayout that has an Image with rounded corners. I\'ve seen many examples how to do that but not exactly what I want. In most
You can just use RoundedBitmapDrawable from Android Support Library v4. All you need is create an instance and set corner radius:
RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), bitmap);
final float roundPx = (float) bitmap.getWidth() * 0.06f;
roundedBitmapDrawable.setCornerRadius(roundPx);