Index of the item that is clicked in ListView
<p>Android:
Hello, i am trying to get index of the item that is clicked but i don't know how i can do it.
I want if i click on any item in listview it will open SmsManager with number of this item(Phone Number).
Can somebody tell me how i can do it?</p>

<p>There is source code:</p>

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

            @Override
            public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position,
                    long id) {
                SmsManager m = SmsManager.getDefault();
                Uri uriSMSURIs = Uri.parse("content://sms/inbox");
                Cursor cc = getContentResolver().query(uriSMSURIs, null, null, null, null);
                String phoneNumber  = cc.getString(cc.getColumnIndex("address"));
                m.sendTextMessage(phoneNumber , null, phoneNumber , null, null);


            }

        });
</code></pre>
