newBatsmanSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
if (i>0)
{
String text= newBatsmanSpinner.getSelectedItem().toString();
newBatsman=text;
//Toast.makeText(adapterView.getContext(),text, Toast.LENGTH_SHORT).show();
}
}
我希望在单击项目时将其值分配给全局变量,但不要