我从MySQL填充spinner数据 [表1,表2,表3 .....等等]但是现在我想要当我选择任何位置或表时它将从微调器列表中禁用
adapter= new ArrayAdapter<String>(this, R.layout.spinner_item_layout,R.id.txt,listItems);
sp.setAdapter(adapter);
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String SelectedItem=sp.getItemAtPosition(position).toString();
// String SelectedItem=sp.getSelectedItem().toString();
if(id==0){
}else {
Intent intent = new Intent();
intent.putExtra("spinnerData", SelectedItem);
intent.setClass(MainActivity.this, SecondActivity.class);
startActivity(intent);
}
}