Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active July 4, 2019 22:29
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/0ef4c42732c08ba3e13402563a011404 to your computer and use it in GitHub Desktop.
Save parzibyte/0ef4c42732c08ba3e13402563a011404 to your computer and use it in GitHub Desktop.
spinnerCategoriasReporteGastos.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onNothingSelected(parent: AdapterView<*>?) {
Toast.makeText(context!!, "onNothingSelected", Toast.LENGTH_SHORT).show()
}
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
if (!banderaListener) {
banderaListener = true
return
}
// A partir de acá, podemos asumir que la llamada es genuina y generada por el usuario
Toast.makeText(context!!, "onItemSelected position: $position. id: $id", Toast.LENGTH_SHORT).show()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment