getSelectedItemPosition() of a spinner always returns 0
问题 I'm trying to make the alert box show the selected item on the spinner and I'll need the position later on the code. I tested and the spiAli.getSelectedItemPosition() only returns 0 even before the switch. Here is my string: private static final String[] listaAlimentos = {"Arroz","Feijão","Bife"}; ArrayAdapter<String> alistaAlimentos; And the function that's not working: butFinalizar.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String escolhaAlimento = null