android - Spinner- How to convert from getSelectedItem().toString() from a spinner, back to a spinner? -


i have spinner , want selected item string , this:

spinner to; string string = to.getselecteditem().tostring; 

my question how convert "string" spinner widget?

this better:

how set selected item of spinner value, not position?

this work: (my answer) create spinner array(list). if want set spinner string got spinner itself, work:

for (int = 0; < array.size(); i++) {     if (array.get(i).equals(string) {         spinner.setselection(i)     } } 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -