title: How do I change the alpha value of checkbox with customized image?
body: <p>I want to change the alpha value of the checkbox that in list view. I can change the image for the checkbox. But cannot change the alpha value of it.</p>
  
  <p>layout/list_item.xml</p>
  
  <pre><code>&lt;LinearLayout android:id="@+id/col_1"
      android:layout_width="wrap_content" android:layout_height="wrap_content"
      android:orientation="vertical"&gt;
      &lt;CheckBox android:id="@+id/myCheckBox"
          android:layout_height="wrap_content" android:layout_width="wrap_content"
          android:button="@drawable/bell_checkbox" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>drawable/bell_checkbox.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@drawable/bell" android:state_checkable="true" /&gt;
      &lt;item android:drawable="@drawable/bell" android:state_checkable="false" /&gt;
  
      &lt;item android:drawable="@drawable/bell" android:state_checked="true" /&gt;
      &lt;item android:drawable="@drawable/bell" android:state_checked="false" /&gt;
  
      &lt;item android:drawable="@drawable/bell" android:state_enabled="true" /&gt;
      &lt;item android:drawable="@drawable/bell" android:state_enabled="false" /&gt;
  
      &lt;item android:drawable="@drawable/bell" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>The code below works, but not what I want</p>
  
  <pre><code>AlphaAnimation alpha = new AlphaAnimation (1f, 0.5f); // from 100% visible to 50%
  alpha.setDuration (1000); // 1 second, or whatever you want
  alpha.setFillAfter(true);
  holder.myCheckBox.startAnimation(alpha);
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>holder.myCheckBox.getBackground().setAlpha(50);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>holder.myCheckBox.getBackground().getCurrent().setAlpha(50);
  </code></pre>
  
  <p>Both cannot change the alpha value.</p>
  
  <p>I think the way that I get the drawable object from my customized checkbox is incorrect:
  holder.myCheckBox.getBackground() - It cannot get the drawable object form getBackground() as I set the customized drawable to android:button.</p>
  
  <p><strong>How can I get the drawable of android:button?</strong></p>
  
  <p>Can anyone give me some hints?</p>