title: When changing the background of app from java when a menu is clicked it doesn't take the right color
body: <p>I am trying to change the color of the background app when I click a menu for example change background black.
  The color it is changing for the first time into transparent so like grey and than stays blue.</p>
  
  <p>I want if the color is red to take red and other colors.
  This is my code.</p>
  
  <pre><code> mPopupMenu = new PopupMenu(this, settings);
          MenuInflater menuInflater = mPopupMenu.getMenuInflater();
          menuInflater.inflate(R.menu.main_settings, mPopupMenu.getMenu());
          settings.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  mPopupMenu.show();
                  mPopupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                      @Override
                      public boolean onMenuItemClick(MenuItem item) {
                          int id = item.getItemId();
                          if(id == R.id.menu_back_white) {
                              setActivityBackgroundColor(R.color.white);
                          } else if (id == R.id.menu_back_black) {
                              setActivityBackgroundColor(R.color.material_grey_900);
                          }
                          return false;
                      }
                  });
  
              }
          });
  
   public void setActivityBackgroundColor(int color) {
          View view = this.getWindow().getDecorView();
          view.setBackgroundColor(color);
      }
  </code></pre>
  
  <p>colors</p>
  
  <pre><code>&lt;color name="material_grey_900"&gt;#ff212121&lt;/color&gt;
  &lt;color name="white"&gt;#FFFFFF&lt;/color&gt;
  </code></pre>
  
  <p>styles</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/blue_900&lt;/item&gt;
          &lt;item name="colorPrimary"&gt;@color/blue_300&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/blue_300&lt;/item&gt;
          &lt;item name="colorControlNormal"&gt;@color/white&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YkZCM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YkZCM.png" alt="enter image description here"></a></p>