title: Android Studio include "change color" options in app
body: <p>I am programming an Android App and I am trying to include a "change color" option (in a settings-screen for example).
  What I found out is that there are three colors in the "colors.xml" file (app->src->main->res->values):</p>
  
  <pre><code>&lt;color name="colorPrimary"&gt;#3F51B5&lt;/color&gt;
  &lt;color name="colorPrimaryDark"&gt;#303F9F&lt;/color&gt;
  &lt;color name="colorAccent"&gt;#ff4040&lt;/color&gt;
  </code></pre>
  
  <p>The idea is, if possible, to change those colors by a press on a button, for example (a red button will change to red theme, a blue one to blue theme, and so on).
  Is this anyhow possible? And if not, do you have a different idea to change colors?
  I'm sorry if a question like this already exists. I did not find anything but I also had no idea what to look for.</p>
  
  <p>Thank you in advance :)</p>
  
  <p>Edit:</p>
  
  <p>currently, I am trying it that way:</p>
  
  <pre><code>@Override
  public void onClick(View v) {
      switch (v.getId()) {
          case R.id.btn_dark:
          setTheme(R.style.BlackTheme);
          Toast.makeText(context, "Dark", Toast.LENGTH_SHORT).show();
          break;
      case R.id.btn_light:
          setTheme(R.style.LightTheme);
          Toast.makeText(context, "Light", Toast.LENGTH_SHORT).show();
          break;
      case R.id.btn_settings_save:
          Intent i = new Intent(SettingsActivity.this, MainActivity.class);
          startActivity(i);
          finish();
          break;
      }
  }
  </code></pre>
  
  <p>Meaning, I want to change it by calling the onCreate in the MainActivity when pressing the save button I am trying to reset the "setContentView".</p>
  
  <p>Where do I have to set all the Themes? In the Manifest? Because when I set it in the OnCreate I will overwrite my changes done in the "settings"-Activity, or am I wrong with that?</p>