Last active
October 1, 2019 01:03
-
-
Save dandvl/230a7881203ab137ae32bdcd7995dbe5 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
//ONE | |
var listaObjetos = mutableListOf("uno", "dos", "tres") | |
var adaptador = ArrayAdapter(this, R.layout.prueba,R.id.textView, listaObjetos) | |
spinner.adapter = adaptador | |
//TWO | |
spinner.adapter = ArrayAdapter.createFromResource(this@MainActivity, R.array.arreglo, android.R.layout.simple_spinner_item) | |
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { | |
override fun onItemSelected(parent: AdapterView<*>, view: View, | |
position: Int, id: Long) { | |
Toast.makeText(this@MainActivity, parent.selectedItem.toString(), Toast.LENGTH_SHORT).show() | |
} | |
override fun onNothingSelected(parent: AdapterView<*>) {} | |
} | |
//CURSOR | |
//CUSTOM | |
//RECYCLER | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment