I’m new to android development and i’m trying to write something with background color which i set in the main.xml file/
My writing code is this
TextView textView = new TextView(this);
textView.setText(s);
setContentView(textView);
When I run the program the “setContentView” overwrite the background color, is there another way of writing which doesnt over write what written in the main.xml file?
you should have the TextView in your XML file and then reference your TextView like this