title: Draw Border on HorizontalScrollView Programmatically
body: <p>I'm trying to draw a border on a HorizontalScrollView programmatically, and fill the inside with a diferent colour. I've tried different aproaches, with no success. I can only draw one thing at a time... Here's the last code i've tried.</p>
  
  <pre><code>private void applyViewBorder(View layout, String borderColor,
          String fillColor, int borderWidth) {
      if (fillColor == null || borderColor == null)
          return;
      RectShape rect = new RectShape();
      ShapeDrawable rectShapeDrawable = new ShapeDrawable(rect);
      Paint paint = rectShapeDrawable.getPaint();
      paint.setStyle(Style.STROKE);
      paint.setStrokeWidth(borderWidth);
      paint.setColor(Color.parseColor(borderColor));
      if (android.os.Build.VERSION.SDK_INT &lt; 16) {
          layout.setBackgroundDrawable(rectShapeDrawable);
      } else {
          layout.setBackground(rectShapeDrawable);
      }
      paint.setStyle(Style.FILL);
      paint.setColor(Color.parseColor(fillColor));
      if (android.os.Build.VERSION.SDK_INT &lt; 16) {
          layout.setBackgroundDrawable(rectShapeDrawable);
      } else {
          layout.setBackground(rectShapeDrawable);
      }
  
  }
  </code></pre>
  
  <p>I've already searched in stack overflow, with no success too...
  Thanks in advance. :)</p>