Can't figure how to retrieve data of a particular row from a ListView
<p>I am developing an android application pertaining to sms. I have managed to display a listView of all the messages in my android emulator, but i can't figure out what code should i write in the onItemClickListener such that whenever i click any row of my listview i should get the data(here.. message body) associated with it in another screen. What ahould i do about this? </p>

<p>My code is given below:</p>

<pre><code>public class mainmenu extends Activity 
{


       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle SavedInstanceState) 
       {
          super.onCreate(SavedInstanceState);
          setContentView(R.layout.main);



         super.onStart();
         {

          final ListView list = (ListView) findViewById(R.id.list);
          List&lt;String&gt; msgList = getSMS();
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, msgList); 
            list.setAdapter(adapter);

            list.setOnItemClickListener(new OnItemClickListener()
            {


                @Override
                public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                        int position, long id) 
                {
                    // TODO Auto-generated method stub

                }

            });

       }
 }






       public List&lt;String&gt; getSMS()
       {

           List&lt;String&gt; sms = new ArrayList&lt;String&gt;();
           Uri uriSMSURI = Uri.parse("content://sms/inbox");
          Cursor cur = getContentResolver().query(uriSMSURI, null, null,null,null);

          while (cur.moveToNext())
          {

              String address=cur.getString(cur.getColumnIndex("address"));
              String body = cur.getString(cur.getColumnIndexOrThrow("body"));
                 sms.add("Number: " + address + " .Message: " + body); 
          }
          return sms;


       }

}
</code></pre>

<p>Please give me the code that i should write in the OnItemClickListener as per the specifications i mentioned above. It's a bit urgent.</p>
