how to fetch number for specific name in spinner select event
<p>i want to fetch contact number by name.name is stored in spinner if i select any name that is store in one spinner.plz check my method how can i fetch number by name.</p>

<p>public void onItemSelected(AdapterView arg0, View arg1,
                    int arg2, long arg3) {</p>

<pre><code>            String[] name=new String[]{arg0.getItemAtPosition(arg2).toString()};
            //name=arg0.getItemAtPosition(arg2).toString();
            String[] projection=new String[]{People.NUMBER};
            //String[] selectionarg=new String[]{People.NAME};
            Cursor cur=getContentResolver().query(People.CONTENT_URI, projection,People.NAME+"=?" ,name, null);
            String result=cur.getString(cur.getColumnIndex(People.NUMBER));
            Toast.makeText(getApplicationContext(), "number is:-"+result, Toast.LENGTH_SHORT).show();

        }
</code></pre>
