-
-
Save parzibyte/a1cc6da9f1ab960a1bd7a7274e386af7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | |
@Override | |
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |
// Fue seleccionado un elemento. Mira position e id | |
if (!bandera) { | |
// Es la primera vez cuando es creada, así que la ignoramos | |
bandera = true; | |
return; | |
} | |
// A partir de aquí, las llamadas serán genuinas | |
} | |
@Override | |
public void onNothingSelected(AdapterView<?> parent) { | |
// Nada fue seleccionado. Por cierto, no he visto que este método se desencadene | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment