title: ArrayAdapter in android to create simple listview
body: <p>I tried to create an <code>Activity</code> in Android, This Activity only contains a <code>ListView</code> nothing else.</p>
  
  <p>As I know to fill the listview we need to use an <code>ArrayAdapter</code>.</p>
  
  <p>So to understand the ArrayAdapter I have read the following link:</p>
  
  <p><a href="http://developer.android.com/reference/android/widget/ArrayAdapter.html" rel="noreferrer">http://developer.android.com/reference/android/widget/ArrayAdapter.html</a></p>
  
  <p>But still I am unable to understand it clearly!</p>
  
  <p>One of the biggest doubt is why the constructor needs a <code>TextView</code> resource id while my activity is not having any TextViews what I should have to give it?</p>
  
  <p>I am not saying that this is the only constructor, just that I'm unable to understand the logic behind it.</p>
  
  <p>In order to create a simple listview I also referred to the following link:</p>
  
  <p><a href="http://androidexample.com/Create_A_Simple_Listview_-_Android_Example/index.php?view=article_discription&amp;aid=65&amp;aaid=90" rel="noreferrer">Simple ListView using ArrayAdapter example.</a></p>
  
  <p>But again my main doubt is why it does it need a TextView resource id?</p>
  
  <p>If anybody can explain it with an example it will be very helpful.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
            android.R.layout.simple_list_item_1, android.R.id.text1, values);
  </code></pre>