0
 val spinner: Spinner = findViewById(R.id.spinner)
        ArrayAdapter.createFromResource(
            this,
            R.array.cephe,
            android.R.layout.simple_spinner_item
        ).also { adapter ->
            // Specify the layout to use when the list of choices appears
            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
            // Apply the adapter to the spinner
            spinner.adapter = adapter
        }

There is a my spinner code.

 override fun onItemSelected(parent: AdapterView<*>, view: View?, pos: Int, id: Long) {

}

override fun onNothingSelected(parent: AdapterView<*>) {

}

I think I need to write something between the controls written here to ensure the control?

KKot
  • 161
  • 3
  • 9
  • https://stackoverflow.com/help/how-to-ask - your question is quite unclear. What do you mean "ensure the control"? You have posted two functions with no implementation. What have you actually tried to solve your own problem? – dominicoder Dec 13 '21 at 00:36
  • Actually it's a simple question. I have some values in my spinner. For ex. Mercury Venus Earth I need to check if these values are selected and check which one is selected. The two empty functions here are excerpts from the spinner section of android's own site. I just didn't understand what these functions do and thought they would be used when checking for this selection. That's why I added it to the question. – KKot Dec 13 '21 at 05:57
  • Yes. Thank you!! – KKot Dec 13 '21 at 09:36

0 Answers0