Setting the position within a spinner

Posted by eric on Stack Overflow See other posts from Stack Overflow or by eric
Published on 2010-04-11T20:47:34Z Indexed on 2010/04/11 20:53 UTC
Read the original article Hit count: 582

Filed under:
|

Good Afternoon,

I have a spinner array containing 3 spinners. Each spinner is populated via a res string array. Each array contains the numbers 1-100. When the activity starts each spinner contains a string array of 1-100 and when you click on a spinner the first choice is 1.

Say a user picks 25 on the first spinner. I'd like the 2nd spinner to show 25 as the starting point for scrolling when the spinner is clicked but not fire the spinner. The 2nd spinner would still contain the array 1-100 though so a user could scroll down to a lessor number if the wanted to.

I've tried using setSelection but that causes the 2nd spinner to fire causing undesirable effects (an edit box is populated with the 2nd number even though the user hasn't clicked the 2nd spinner). I would like the 2nd spinner to just show 25 as the starting point.

How do I do this?

© Stack Overflow or respective owner

Related posts about android

Related posts about spinner