title: Image related issue when creating button dynamically
body: <p>In my sample app, I try to create <code>Button</code> dynamically using the below code. Everything works fine, but once I set the background image to the button, what I notice is that the image becomes oval in shape. But in actual the image are circle in shape. Why this happens, is anything to do in my code? Help me to solve this.</p>
  <p><strong>main.xml file</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:id=&quot;@+id/calendar_layout&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;
      android:background=&quot;#ffffff&quot;
      android:orientation=&quot;vertical&quot; &gt;
  
      &lt;ViewFlipper
          android:id=&quot;@+id/flipview&quot;
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot; 
          android:background=&quot;#ffffff&quot;&gt;
  
          &lt;LinearLayout
              android:id=&quot;@+id/liVLayout&quot;
              android:layout_width=&quot;fill_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:gravity=&quot;center_vertical|center_horizontal&quot;
              android:orientation=&quot;vertical&quot; &gt;
          &lt;/LinearLayout&gt;
      &lt;/ViewFlipper&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p><strong>Jave code</strong></p>
  <pre><code>public class MainActivity extends Activity 
  {
      private Button[][]          m_pBtnDay; 
      
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          
          m_pBtnDay = new Button[6][7];
          
          initDay();
      }
      
      public boolean initDay()
      {
          LinearLayout layoutVertical = (LinearLayout) findViewById(R.id.liVLayout);
          LinearLayout rowLayout = null;
          
          LayoutParams param = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 1);
  
          for (int i = 0; i&lt;6; i++)
          {
              rowLayout = new LinearLayout(this);
              rowLayout.setWeightSum(7);
              
              layoutVertical.addView(rowLayout, param);
              
              for(int j=0; j&lt;7; j++)
              {
                  m_pBtnDay[i][j] = new Button(this);             
                  m_pBtnDay[i][j].setTextSize(15);    
                  m_pBtnDay[i][j].setBackgroundResource(R.drawable.theme1_cal_button_selected);
                  rowLayout.addView(m_pBtnDay[i][j], param);                                                          
              }                           
          }                       
          
          return true;
      }       
  }
  </code></pre>
  <p><strong>Screenshot</strong></p>
  <p><img src="https://i.stack.imgur.com/syFUH.png" alt="enter image description here" /></p>