how to retrieve contact number according to name in spinner
<p>i am new in android development.my application want contact number according to name that i have to select from spinner i use android 1.6.</p>

<pre><code>    public void onItemSelected(AdapterView&lt;?&gt; parent, View arg1,
                    int pos, long arg3) 

            {

                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 in advance
Regards:
Arpit</p>
