Android id fetching problem
<p>spinner.setOnItemSelectedListener(new OnItemSelectedListener() 
            {</p>

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

            {

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

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

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

                pCur.moveToFirst();
                if(pCur.moveToFirst())
                {
                    String id;
                    int x=0;
                    do
                    {
                        id=pCur.getString(pCur.getColumnIndex(People._ID));
                        Toast.makeText(parent.getContext(),"resule::"+id,Toast.LENGTH_LONG).show();
                        x++;

                    }while(pCur.moveToNext());
                }

            }


            public void onNothingSelected(AdapterView&lt;?&gt; arg0)
            {

                // DO Nothing
            }

        });
</code></pre>

<p>I am novice in android development.spinner has all contact name i want get id from particular name.please help me.</p>

<p>Thanks in advance</p>

<p>Regards
Arpit Trivedi</p>
