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
Post a Comment