Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 4, 2019 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a1cc6da9f1ab960a1bd7a7274e386af7 to your computer and use it in GitHub Desktop.
Save parzibyte/a1cc6da9f1ab960a1bd7a7274e386af7 to your computer and use it in GitHub Desktop.
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