title: Creating an Android View with a particular style programmatically
body: <p>Other <a href="https://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view">questions</a> say that the style cannot be set programmatically, but a <code>View</code> can be <em>initialised</em> with a style such as when it is loaded from XML.</p>
  
  <p>How can I initialise a <code>View</code> with a particular style programmaticly (not in XML)? I tried using <a href="http://developer.android.com/reference/android/view/View.html#View%28android.content.Context,%20android.util.AttributeSet,%20int%29" rel="nofollow noreferrer">View(Context context, AttributeSet attrs, int defStyle)</a>, but I don't know what to parse in for the second argument. Passing in <code>null</code> results in the <code>View</code> not being displayed</p>