title: Android Button background is not recognizing/using the drawable
body: <p>I want to add a background to a button, as I have already done several times. I have a drawable resource file with the appropriate background. However, if I link this, it will not be accepted, instead only one color will be used as the background.
  I had the suspicion that it could be a mistake in my Styles.xml but nothing is called too colored in these. What can be the reasons why Android Studio does not recognize a background or where could I have defined a general theme of how buttons should look? I can't remember having put on something like that. I tried something similar with an EditText, I had no problems here, so I think it is a specific button problem.
  Also if I change the background color to a plain whit it is not changing anything and still showing a dark blue.</p>
  
  <p>Update: If I change the preview style (upper middel of the preview) to DialogStyle the button background works. How can that be if there is nothing defined in der styles?</p>
  
  <p>Update: I added a new version of my button this time initializing the background in a extra style. Result is that it is still not showing the right color. I also tried it with black but nothing happend.</p>
  
  <p>Thanks for any help. </p>
  
  <p><strong>Button</strong></p>
  
  <pre><code>&lt;Button
                  android:id="@+id/buttonRegistrieren"
                  android:layout_width="232dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_vertical|center_horizontal"
                  android:layout_marginTop="20dp"
                  android:layout_marginBottom="5dp"
                  android:background="@drawable/btnbackground"
                  android:onClick="WriteData"
                  android:text="@string/Registrieren"
                  android:textAllCaps="false"
                  android:textColor="@color/colorWhite"
                  android:textSize="16dp"&gt;&lt;/Button&gt;
  </code></pre>
  
  <p><strong>Styles.xml</strong></p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;!-- Base application theme. --&gt;
      &lt;style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"&gt;
          &lt;!-- Customize your theme here. --&gt;
  
      &lt;/style&gt;
  
      &lt;style name="AppTheme.NoActionBar"&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
      &lt;style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /&gt;
  
      &lt;style name="ToolbarColoredBackArrow" parent="AppTheme"&gt;
          &lt;item name="android:textColorSecondary"&gt;@android:color/black&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style
          name="SplashTheme"
          parent="AppTheme"&gt;
          &lt;item name="android:windowFullscreen"&gt;true&lt;/item&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  &lt;style name="ButtonStyle" parent="android:style/Widget.Button"&gt;
          &lt;item name="android:textSize"&gt;19sp&lt;/item&gt;
          &lt;item name="android:textColor"&gt;@color/colorWhite&lt;/item&gt;
          &lt;item name="android:background"&gt;@color/colorBlack&lt;/item&gt;
      &lt;/style&gt;
  
  
  
      &lt;style
          name="SecondTheme"
          parent="AppTheme"&gt;
          &lt;item name="android:windowFullscreen"&gt;false&lt;/item&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="DialogStyle" parent="Theme.Design.Light.BottomSheetDialog"&gt;
          &lt;item name="android:windowIsFloating"&gt;false&lt;/item&gt;
          &lt;item name="android:statusBarColor"&gt;@android:color/transparent&lt;/item&gt;
          &lt;item name="android:windowSoftInputMode"&gt;adjustResize&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p><strong>btnbackground.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="rectangle"&gt;
  
      &lt;gradient
          android:angle="135"
          android:centerColor="#FF5256AC"
          android:endColor="#FF662D91"
          android:startColor="#FF29ABE2"
          android:type="linear" /&gt;
  
  
      &lt;corners android:radius="150dp"&gt;
  
      &lt;/corners&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p><strong>Button with Theme</strong></p>
  
  <pre><code>&lt;Button
          android:id="@+id/buttonLogin"
          android:layout_width="160dp"
          android:layout_height="45dp"
          android:layout_marginStart="8dp"
          android:layout_marginEnd="8dp"
          android:text="Anmelden"
          android:textAllCaps="true"
          android:textColor="@color/colorWhite"
          android:textSize="16sp"
          android:theme="@style/ButtonStyle"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.497"
          app:layout_constraintStart_toStartOf="parent"
          tools:layout_editor_absoluteY="426dp"
          /&gt;
  </code></pre>
  
  <p><strong>Manifest</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="edmt.dev.androideatitv2client"&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"
          tools:replace="android:theme"&gt;
          &lt;activity android:name=".PasswordActivity"&gt;&lt;/activity&gt;
          &lt;activity android:name=".LoginActivity" /&gt;
          &lt;activity android:name=".RegistrationActivity" /&gt;
          &lt;activity android:name=".SplashActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".UpdatePasswordActivity" /&gt;
          &lt;activity android:name=".UpdateProfileActivity" /&gt;
          &lt;activity android:name=".ProfileActivity" /&gt;
  
          &lt;activity
              android:name=".HomeActivity"
              android:label="@string/title_activity_home"
              android:theme="@style/AppTheme.NoActionBar" /&gt;
  
          &lt;service android:name=".services.MyFCMServices"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>