title: How to Create an Activity with ListView
body: <p>I'm new to android, so this may also seem like a dumb question.  I have a listview and I populated it with some data via an adapter.  However, I tried to use the code for the clickItem method, but I get red squiggly lines.  All I want is for when someone clicks one of the items in a list view, it will play a song.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>package com.juwar74.alarabic;
  
  import java.util.ArrayList;
  import java.util.List;
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  
  public class OneExp extends ActionBarActivity 
  {
       private ListView lv; 
       private ArrayAdapter&lt;String&gt; arrayAdapter;
  
       @Override
       protected void onCreate(Bundle savedInstanceState) 
       {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.one_exp);
  
           lv = (ListView) findViewById(R.id.list);
  
           List&lt;String&gt; Exp_list = new ArrayList&lt;String&gt;();
           Exp_list.add("Hello.");
           Exp_list.add("How are you?");
           Exp_list.add("I'm fine.");
           Exp_list.add("Thank you.");
           Exp_list.add("My name is...");
           Exp_list.add("Nice to meet you.  Please call me...");
           Exp_list.add("What's your name?");
           Exp_list.add("Good Morning.");
           Exp_list.add("Good Evening.");
           Exp_list.add("You're welcome.");
           Exp_list.add("Good bye.");
  
           arrayAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, Exp_list);
           lv.setAdapter(arrayAdapter);
           lv.setOnItemClickListener(new .OnItemClickListener() 
           {
               @Override
               public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                       int position, long id) 
               {
                   arrayAdapter = ...;
               }
           }); 
       }
  } 
  </code></pre>
  
  <p>The red squiggly lines are at the setOnItemClick and the .OnItemClick. It seems like the most basic operations are the hardest to find on the internet.  All the sites I go to will show you how to set up a listview, but they don't go beyond that.  No one really teaches how to interact with the listview in details....Strange.</p>