How to set background color of an Activity to white programmatically?

SJS picture SJS · Jan 21, 2011 · Viewed 255.5k times · Source

How can I set the background color of an Activity to white programatically?

Answer

Arunkumar picture Arunkumar · Dec 13, 2012

Add this single line in your activity, after setContentView() call

getWindow().getDecorView().setBackgroundColor(Color.WHITE);