Android Question Spinner.SelectedIndex=anyvalue doesn't trigger Spinner_ItemClick Sub

ivanthomson

Member
Licensed User
Longtime User
I just noticed that

Spinner.SelectedIndex.0 (or any value)

won't trigger the matching

Spinner_ItemClick (Position as Int, Value as Object) sub routine.

Is it suppose to, or is this the correct functionality?

It just seems a bit weird to programmatically change a spinner value and not trigger the _ItemClick subroutine. But, maybe I am incorrect in my thinking?

Thanks.

P.S.

However, I am aware that you can simply use the following to trigger the event sub;

Spinner_ItemClick(0,"Whatever")

Which accomplishes the task. But, I am just curious as to why it doesn't trigger it when you change the spinner position/value via code?
 
Last edited:

ivanthomson

Member
Licensed User
Longtime User
Hi Erel,

Yeah I gathered that, but thanks for the confirmation.

However, it's a little weird because a spinner doesn't trigger when you change the position/value via code, and an edittext does. If you change the text in an edit text through code (without user interaction) it will trigger the textchanged sub.

So, I'm just pointing out that some views/objects don't seem to trigger their corresponding subs when you alter them by code, while others do.

Which leads me to my next question,

Is there a way to alter the text in an edittext through code without it triggering the sub?

Thanks.
 
Upvote 0
Top