【发布时间】:2011-07-27 14:26:21
【问题描述】:
我是安卓开发新手。我想根据存储在微调器中的名称进行编号,我该如何使用查询在 1.6 中进行操作,请帮助我。
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();
}
});
【问题讨论】: