title: Drawing programmatically oval shape with border (corner radius) on Android
body: <p>I`m trying to draw custom ShapeDrawable with OvalShape, filled with white and with grey border. I created a drawable like this:</p>
  
  <pre><code>ShapeDrawable drawable = new ShapeDrawable(new OvalShape());
  drawable.getPaint().setColor(Color.GRAY);
  drawable.getPaint().setStyle(Style.STROKE);
  drawable.getPaint().setStrokeWidth(getPixels(5));
  drawable.getPaint().setAntiAlias(true);
  </code></pre>
  
  <p>But the result of that was: <a href="http://imageshack.us/photo/my-images/825/device20130306143953.png/" rel="noreferrer">corners problem</a></p>
  
  <p><img src="https://i.stack.imgur.com/11gWS.png" alt="enter image description here"></p>
  
  <p>The idea is  programmatically to create a shape like this but with different colors:</p>
  
  <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" 
  android:shape="oval"&gt;
  &lt;corners android:radius="10dip"/&gt;
  &lt;stroke android:color="#FF0000" android:width="5dip"/&gt;
  &lt;solid android:color="@android:color/transparent"/&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>How can can be fix this?</p>