0

What is the hex code for the default white background that is given to layouts when you create a new project?

enter image description here

Henry
  • 1,042
  • 2
  • 17
  • 47
  • 4
    I'm voting to close this question as off-topic because it should be asked in another Stack Exchenge network, or researched tools or ways to achieve the non-programming related need. – falsarella Feb 23 '15 at 23:49

1 Answers1

1

This answer shows you to get the default background color.

To summarize, just do something like this

TypedValue a = new TypedValue();
getTheme().resolveAttribute(android.R.attr.windowBackground, a, true);
int color = a.data;

Then color will contain the value. This might be useful because the background might be different across different platforms (as the javadoc mentions, you can only count on the background being light).

Community
  • 1
  • 1
k_g
  • 4,333
  • 2
  • 25
  • 40
  • The `color` variable will contain the correct hex code (albeit in the form of an integer rather than a String). If you just want the hex code of the image you posted, I suggest using the "paint test" tool in an image manipulation system to give you the value. – k_g Feb 23 '15 at 22:54