Found by me:
View v = findViewById(R.id.layout_id); LayerDrawable bgDrawable = (LayerDrawable)v.getBackground(); final GradientDrawable shape = (GradientDrawable) bgDrawable.findDrawableByLayerId(R.id.shape_id); shape.setColor(----);