Drawable color scatters after setting in programmatically (Android studio JAVA)

8 views Asked by At

So After I set the color for my LinearLayout Background drawable programmatically for a certain view, the other views change to that color, even when the original view in the xml is not that color.

This is the code I used to set the background of my LinearLayout

int color = Color.parse("some_color")
GradientDrawable gb = (GradientDrawable) linearbackground.getBackground();
gb.setColor(color)
0

There are 0 answers