我的代码是:
spin2.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View arg1,
int position, long id) {
Toast.makeText(getApplicationContext(), "item selected",
Toast.LENGTH_SHORT).show();
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
}
);
我在微调器中实现了 setSelectedItem 为:
spin2.setSelection(new Date().getMonth());
我想在选择项目时显示吐司。它不应自动显示。