title: how to translate XML layout background attribute value into code?
body: <p>I'm sure this is really easy, but one of those hard to find things for beginners!  Here's what I have in my layout XML file which I want to play around with programatically:</p>
  
  <pre><code>&lt;View 
      android:layout_width="fill_parent" 
      android:layout_height="1dp" 
      android:background="?android:attr/listDivider" 
  /&gt; 
  </code></pre>
  
  <p>And here is how far I've gotten with the code:</p>
  
  <pre><code>View ruler = new View(this);
  ruler.setBackgroundDrawable(????); //or is it setBackgroundResource?
  parent.addView(ruler, 
                 new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, 1));
  </code></pre>
  
  <p>I'm stuck on how to translate "?android:attr/listDivider" into code and which setter on the View object I'm interested in. Can anyone help with this?  Thanks!</p>