getting the text of the listitem which i clicked in android
<p>i have a listview. i have to get the text of the list item which i clicked. i tried using onitemclick. but i am not able to get. can some 1 please explain me how to get it.</p>

<p>here is my onitemclick method</p>

<pre><code>lstcities.setOnItemClickListener(new OnItemClickListener() {

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

//              String str =(String) lstcities.getItemAtPosition(position);
                String S =view.getContext().toString();
            Toast.makeText(getApplicationContext(),
                  "Click ListItem Number " +  S, Toast.LENGTH_LONG)
                  .show();
</code></pre>

<p>thanks
 ramu</p>
