I have a problem with setting background color via Spinner that is in Settings Activity. Can someone help me? App doesn't crush, but also it don't change color.
I tried a lot of solutions, but none works for me...
Here is my Save button from SettingsActivity
String color = spinnerColor.getSelectedItem().toString();
View view = findViewById( R.id.list );
View root = view.getRootView();
if (color == "Red")
{
root.setBackgroundColor(0x11001100);
}
else if (color == "Green")
{
root.setBackgroundColor(0x01000100);
}
else if (color == "Blue")
{
root.setBackgroundColor(0x00000001);
}
else
{
root.setBackgroundColor(0x16762880);
}
I expect to change color when button in Settings is pressed, but nothing happens.
I used wrong compare action, this is correct:
if (color.equals("Red"))
User contributions licensed under CC BY-SA 3.0