fetching phone number according to name
<p>i want to get number from name that i select from spinner how can i do.i think first i want to id for particular name.can any one help me.</p>

<p>public void onItemSelected(AdapterView parent, View arg1, int pos, long arg3)</p>

<pre><code>        {

            String name,phoneNumber;
            name=parent.getItemAtPosition(pos).toString();

            String[] projection1 = new String[]{
                    People._ID,People.NAME,People.NUMBER
                 };

            Cursor cur=getContentResolver().query(People.CONTENT_URI, projection1,People.NAME+"="+name , null, null);               

            phoneNumber=cur.getString(cur.getColumnIndex(People.NUMBER));
            Toast.makeText(parent.getContext(), "number="+phoneNumber,Toast.LENGTH_LONG).show();
           /* cur.moveToFirst();
                 if(cur.moveToFirst())
                 {
                     do
                     {



                     }while(cur.moveToNext());

                 }*/
        }
</code></pre>

<p>Thanks &amp; Regards
Arpit Trivedi</p>
