title: Use XML to specify elements of a ListView (or other similar component)
body: <p>The Android documentation implies that I should prefer to use XML when declaring the UI: <a href="http://developer.android.com/guide/topics/ui/declaring-layout.html" rel="nofollow">http://developer.android.com/guide/topics/ui/declaring-layout.html</a></p>
  
  <p>Regardless of whether you agree that it implies this, my personal preference <em>is</em> to use XML when possible.</p>
  
  <p>However, for ListView the documentation only explains how to populate it programmatically: <a href="http://developer.android.com/guide/topics/ui/layout/listview.html" rel="nofollow">http://developer.android.com/guide/topics/ui/layout/listview.html</a></p>
  
  <p>How do I, say, create a ListView with three elements using only the XML layout file? Is this impossible or undesirable?</p>
  
  <p>Being used to developing for the Desktop, I am not accustomed to being required to manually create elements of UI containers, so I am confused as to whether I am missing something or things are different in Android.</p>