title: How to set Style for a button in Android?
body: <p>I have defined the below files in res folder.</p>
  
  <p>styles_apptheme.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;!-- Generated with http://android-holo-colors.com --&gt;
  &lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
    &lt;style name="ButtonAppTheme" parent="android:Widget.Holo.Light.Button"&gt;
        &lt;item name="android:background"&gt;@drawable/apptheme_btn_default_holo_light&lt;/item&gt;
    &lt;/style&gt; 
  &lt;/resources&gt;
  </code></pre>
  
  <p>themes_apptheme.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;!-- Generated with http://android-holo-colors.com --&gt;
  &lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
    &lt;style name="AppTheme" parent="@style/_AppTheme"/&gt;
  
    &lt;style name="_AppTheme" parent="Theme.AppCompat.Light"&gt;
  
      &lt;item name="android:editTextBackground"&gt;@drawable/apptheme_edit_text_holo_light&lt;/item&gt;
  
      &lt;item name="android:buttonStyle"&gt;@style/ButtonAppTheme&lt;/item&gt;
  
    &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>In my Layout.xml file, i have defined my button as below</p>
  
  <pre><code>&lt;Button
          android:id="@+id/btnAddTitle"
          android:layout_below="@id/edEnterTitleValue"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/btn_AddTitle"
          android:layout_margin="20dp"
  /&gt;
  </code></pre>
  
  <p>If i add the below line to the button view above,</p>
  
  <pre><code>android:background="@style/ButtonAppTheme"
  </code></pre>
  
  <p>Application crashes saying that drawable resource should be set for the background attribute. </p>
  
  <p>So i created the below drawable file - abc.xml</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:state_window_focused="false" android:state_enabled="true"
          android:drawable="@drawable/apptheme_btn_default_normal_holo_light" /&gt;
      &lt;item android:state_window_focused="false" android:state_enabled="false"
          android:drawable="@drawable/apptheme_btn_default_disabled_holo_light" /&gt;
      &lt;item android:state_pressed="true"
          android:drawable="@drawable/apptheme_btn_default_pressed_holo_light" /&gt;
      &lt;item android:state_focused="true" android:state_enabled="true"
          android:drawable="@drawable/apptheme_btn_default_focused_holo_light" /&gt;
      &lt;item android:state_enabled="true"
          android:drawable="@drawable/apptheme_btn_default_normal_holo_light" /&gt;
      &lt;item android:state_focused="true"
          android:drawable="@drawable/apptheme_btn_default_disabled_focused_holo_light" /&gt;
      &lt;item
           android:drawable="@drawable/apptheme_btn_default_disabled_holo_light" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>If i set  <code>android:background="@drawable/abc"</code> i dont see the style set in the button.</p>
  
  <p>So please let me know how i can set the style for the button.</p>
  
  <p>Thanks.</p>