title: Is there a way to programmatically set src image for ToggleButton?
body: <p>I am using a <code>ToggleButton</code> with an image. The image is 16x16, however, I want the button to be 50x50 so that when users click around the image even then the action is taken. This is how I'm avoiding the fat finger problem. </p>
  
  <p>This is how my <code>ToggleButton</code> is in the XML</p>
  
  <pre><code>    &lt;ToggleButton android:id="@+id/fav"
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:background="#FFFFFF"
          android:gravity="center"
          android:focusable="false"
          android:layout_marginRight="10dp"
          android:padding="15dp"
          /&gt;
  </code></pre>
  
  <p>and I set the background programmatically like this:</p>
  
  <pre><code>if (holder.favButton.isChecked()) 
    holder.favButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.star_2));
  else 
    holder.favButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.star_1));
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>The image looks expanded and blurry because the width and height is <code>50dp</code>, however, the image is only 16x16. Instead of setting the background with <code>setBackgroundDrawable</code>, I want to find a way to set the image <code>src</code> of the button. Because if I'm setting the background then the image takes over the entire background which is 50x50.               </p>