Question

I have a spinner and its adapter. I have a customized the list and an the spinner view.

The value of the spinner can be modified by 2 ways : - by a user choice - programaticaly

When the user makes a choice, and only if this choice is different from the selected value, I may (or not) want to show a second activity to make him choice a completing value.

If the user cancels this second activity, I want the spinner choice not being validated and stay on its original position.

But I don't want to catch, or be able to identify, programmaticaly changes not to annoy the user with useless choice to do.

But I don't find any way to do this.

Do you have an idea ?

The best I could do is : - remember somewhere the value of the spinner in my class attributes, - trigger and itemSelected event and compare the selected value with the remembered one, - empty the spinner view so the new choice is not visible (because it may not be complete lacking the second choice) - go through the second activity - depending one the result on this second activity, force the old value in the spinner or bring the spinner value visible and this time complete

Doing this, and to filter the user click, I may ALWAYS force the old spinner value memorized to the new one I want to put in programaticaly. If I don't do this, the event is triggered and I don't have any way to prevent the user to go through the second activity.

Do you see a better way to do my stuff ?

Thank you for your help.

Oliver

Was it helpful?

Solution

I have already answered similar quiestion. So just check this: Android Spinner selection

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top