문제

I am having an Android view with a Spinner on it. I call a populateSpinner() method to add some default values to it.

I also have a onItemSelected() event which gets called before the view is completed to print. I would like to run a code inside this block only when the user changes the selected items, not when I add or the form gets created.

How is possible that?

도움이 되었습니까?

해결책

Have you tried waiting until you have populated the Spinner to register the onItemSelectedListener?

다른 팁

Pentium10, I have found a solution for this problem and posted it here (with code sample):

Spinner onItemSelected() executes when it is not suppose to

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top