私はアンドロイド開発には初めてです。私はスピナーに格納されている名前に応じて番号を欲しいです。特定の番号のクエリを使用するには?
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();
}
});
感謝のニコラ、null、null);その後、人々を使用します.NUMBER – Arpit