I am new to android development. I want number according to name that is stored in spinner how can I do in1.6 using query please help me.
spinner.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onNothingSelected(AdapterView<?> arg0)
{
}
@Override
public void onItemSelected(AdapterView<?> parent, View arg1,
int pos, long arg3)
{
String name,s;
int i;
name=parent.getItemAtPosition(pos).toString();
//String projection1[]={People._ID,People.NAME,People.NUMBER};
//Cursor cur=getContentResolver().query(People.CONTENT_URI,
// projection1,People.NAME+"="+name,null,null);
// s=cur.getString(cur.getColumnIndex(People._ID));
Toast.makeText(parent.getContext (),name,Toast.LENGTH_LONG).show();
}
});