Issue
Hello i want to implement a native ad in my app what i want is i can implement my custom colour but i dont know how
here is the line where the colur is to be added
NativeTemplateStyle styles = new
NativeTemplateStyle.Builder().withMainBackgroundColor(background_color).build();
this is the colour i want to implement it is in the color.xml in the values folder
<color name="Card_Elevation_Color">#2c2c2c</color>
Solution
ColorDrawable colorDrawable = new ColorDrawable(getColor(R.color.Card_Elevation_Color));
NativeTemplateStyle styles = new NativeTemplateStyle.Builder().withMainBackgroundColor(colorDrawable).build();
Answered By - MArio
Answer Checked By - Gilberto Lyons (JavaFixing Admin)