Setting Spinner by name
can any one tell hw to set a spinner by name.. The scenario is like this, Spinner contains three elements "one","two","three". After clicking the spin开发者_如何学JAVAner im storing that in shard pref say "two" Now i wan to set to that spinner again to "two", if i open that activity again. Array of the elements is in values/arrays
Rather than storing the string value in your SharedPreferences, store the position within the array as an integer. Then you just call Spinner.setSelection(int position)
with that value.
精彩评论