title: How to extract the text from the selected item on the listView
body: <p>I have a listview with some items. I would like to get the text from the selected item.</p>
  
  <p>Here is my list adapter and the onItemClickListener:</p>
  
  <pre><code>ListView lv = (ListView)findViewById(R.id.listView1);
      lv.setAdapter(new ArrayAdapter&lt;Country&gt;(
              this,R.layout.list_black_text,R.id.list_content, values));
  
  
      lv.setOnItemClickListener(new OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
              int position, long id) {
  ??????
      }});
          }
  </code></pre>
  
  <p>Could you tell me please how to get the String from the selected item.</p>
  
  <p>the method ((TextView) view).getText() does not work, i have a </p>
  
  <pre><code>ClassCastException: android.widget.LinearLayout
  </code></pre>
  
  <p>I have found the solution, maybe somebody will need it:</p>
  
  <pre><code>ListView lv = (ListView)findViewById(R.id.listView1);
      lv.setAdapter(new ArrayAdapter&lt;Country&gt;(
              this,R.layout.list_black_text,R.id.list_content, values));
  
      lv.setOnItemClickListener(new OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
              int position, long id) {
              TextView textView = (TextView) view.findViewById(R.id.list_content);
              String text = textView.getText().toString(); 
              System.out.println("Choosen Country = : " + text);
  
      }});
  </code></pre>