title: Round corner shape RelativeLayout
body: <p>I am working on layout on <code>Android</code> project. 
  Where the layout parameters are coming programmically. My current layout is coming -</p>
  
  <p><a href="https://i.stack.imgur.com/HbuCu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HbuCu.png" alt="enter image description here"></a></p>
  
  <p><strong>Code</strong>-</p>
  
  <pre><code>mRedBackground=initBackground(getResources().getColor(R.color.transparent_red_80), this.mWidthScreen, (int)(0.0984375F * this.mWidthScreen), 0, 0);
  </code></pre>
  
  <p>And <strong>initBackground</strong> looks like-</p>
  
  <pre><code>public RelativeLayout initBackground(int intColor, int intWidthscreen, int intHeight, int intMerginLeft, int intMerginTop)
    {
      RelativeLayout localRelativeLayout = new RelativeLayout(this.mContext);
      if (intColor != 0)
      localRelativeLayout.setBackgroundColor(intColor);
      RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(intWidthscreen, intHeight);
      localLayoutParams.setMargins(intMerginLeft, intMerginTop, 0, 0);
      localRelativeLayout.setLayoutParams(localLayoutParams);
      return localRelativeLayout;
    }
  </code></pre>
  
  <p>But I need it in rounded shape. something like-  <a href="https://i.stack.imgur.com/VWKSn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VWKSn.png" alt="enter image description here"></a></p>
  
  <p>I can not use other than <strong>RelativeLayout</strong> due to project restriction. I also can not use <strong>Background XML</strong> also. All I need to set from code. I am sorry for that. Any Help will be appreciated.</p>