1

I've been trying to figure out how to change the background color of my app while running without success. I would like to display warnings to the user by gradually turning the entire screen from green to red as he approaches the danger zone.

I currently use a custom layout. I can change the color before I compile, but not as the app is running.

Ideas would be much appreciated!

Albin
  • 33
  • 5

1 Answers1

1

I figured it out.

CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);
card.setText(R.string.hello_world);
View v = card.getView();
v.setBackgroundColor(Color.argb(255, 0, 0, 255));      
setContentView(v);
Albin
  • 33
  • 5