'How to print contents of a spinner?

Say that I have a spinner that is populated by

var list = listOf("One", "Two", "Three", "Four", "Five")

How would I access this list if I wanted to print the contents/dropdown list of the spinner?

I would want an output that's similar to how a list is outputted when the entire thing is printed, like:

['One', 'Two', 'Three', 'Four', 'Five']



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source