title: how to convert shape to ShapDrawable in android
body: <p>I have a number of shapes, and I have one view. I need to dynamically (i.e. programmatically) select a shape to set as the background of my view based on user inputs. So my question: who do I programmatically turn a shape into a ShapeDrawable or such? </p>
  
  <p>I already look at <a href="https://stackoverflow.com/questions/7164630/how-to-change-shape-color-dynamically">How to change shape color dynamically?</a>. Those posts assume the shape is already attached to a view. But me all my shapes are free agents.</p>