微调器选择的值未分配全局变量

时间:2019-02-24 16:37:01

标签: java android

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();

                }
            }

我希望在单击项目时将其值分配给全局变量,但不要

0 个答案:

没有答案