title: How to apply custom button to the activity in Android Studio?
body: <p>My MainActivity has 4 buttons, serving as navigation. UI is as below</p>
  <p><img src="https://i.stack.imgur.com/2xejk.png" alt="MainActivity UI" /></p>
  <p>And, I also created button.xml under the drawable folder.</p>
  <pre><code>&lt;!-- res/drawable/button.xml --&gt;
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:shape=&quot;rectangle&quot;&gt;
      &lt;solid android:color=&quot;#457B9D&quot;/&gt;
      &lt;corners android:radius=&quot;20dp&quot;/&gt;
      &lt;stroke android:color=&quot;#fff&quot; android:width=&quot;2dp&quot;/&gt;
  &lt;/shape&gt;
  </code></pre>
  <p>In the activity_main.xml, I wanted to apply the custom button to the view using android:background=&quot;@drawable/button&quot;</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;#A8DADC&quot;
      tools:context=&quot;.MainActivity&quot;&gt;
  
      &lt;LinearLayout
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:gravity=&quot;center&quot;
          android:orientation=&quot;vertical&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;
  
          &lt;Button
              android:id=&quot;@+id/button1&quot;
              android:layout_width=&quot;350dp&quot;
              android:layout_height=&quot;80dp&quot;
              android:layout_marginBottom=&quot;50dp&quot;
              android:background=&quot;@drawable/button&quot;
              android:text=&quot;@string/enter_current_job&quot;
              android:textAllCaps=&quot;false&quot;
              android:textSize=&quot;20sp&quot; /&gt;
  
          &lt;Button
              android:id=&quot;@+id/button2&quot;
              android:layout_width=&quot;350dp&quot;
              android:layout_height=&quot;80dp&quot;
              android:layout_marginBottom=&quot;50dp&quot;
              android:background=&quot;@drawable/button&quot;
              android:text=&quot;@string/enter_job_offer&quot;
              android:textAllCaps=&quot;false&quot;
              android:textSize=&quot;20sp&quot; /&gt;
  
          &lt;Button
              android:id=&quot;@+id/button3&quot;
              android:layout_width=&quot;350dp&quot;
              android:layout_height=&quot;80dp&quot;
              android:layout_marginBottom=&quot;50dp&quot;
              android:background=&quot;@drawable/button&quot;
              android:text=&quot;@string/adjust_comparison_settings&quot;
              android:textAllCaps=&quot;false&quot;
              android:textSize=&quot;20sp&quot; /&gt;
  
          &lt;Button
              android:id=&quot;@+id/button4&quot;
              android:layout_width=&quot;350dp&quot;
              android:layout_height=&quot;80dp&quot;
              android:background=&quot;@drawable/button&quot;
              android:text=&quot;@string/compare_job_offers&quot;
              android:textAllCaps=&quot;false&quot;
              android:textSize=&quot;20sp&quot; /&gt;
      &lt;/LinearLayout&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  </code></pre>
  <p>Also, I changed themes.xml a little bit to NoActionBar</p>
  <pre><code>&lt;resources xmlns:tools=&quot;http://schemas.android.com/tools&quot;&gt;
      &lt;!-- Base application theme. --&gt;
      &lt;style name=&quot;Theme.JobCompare6300&quot; parent=&quot;Theme.MaterialComponents.DayNight.NoActionBar&quot;&gt;
          &lt;!-- Primary brand color. --&gt;
          &lt;item name=&quot;colorPrimary&quot;&gt;@color/purple_500&lt;/item&gt;
          &lt;item name=&quot;colorPrimaryVariant&quot;&gt;@color/purple_700&lt;/item&gt;
          &lt;item name=&quot;colorOnPrimary&quot;&gt;@color/white&lt;/item&gt;
          &lt;!-- Secondary brand color. --&gt;
          &lt;item name=&quot;colorSecondary&quot;&gt;@color/teal_200&lt;/item&gt;
          &lt;item name=&quot;colorSecondaryVariant&quot;&gt;@color/teal_700&lt;/item&gt;
          &lt;item name=&quot;colorOnSecondary&quot;&gt;@color/black&lt;/item&gt;
          &lt;!-- Status bar color. --&gt;
          &lt;item name=&quot;android:statusBarColor&quot; tools:targetApi=&quot;l&quot;&gt;?attr/colorPrimaryVariant&lt;/item&gt;
          &lt;!-- Customize your theme here. --&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>But I am still having the default button. Did I miss anything or did I do something wrong?</p>
  <p><img src="https://i.stack.imgur.com/WO3SO.png" alt="Actual MainActivity UI" /></p>