How to set selected Items from a spinner as a default value, android?

When you goto next screen and comeback then it automatically displays the last selected value by default (if your for loop code not exists here). If you goto previous screen from the spinner screen and come back then spinner will be created again and adapter is set again. So value selected last cannot be set.

If still that is your requirement then save the value to shared preferences when selected. Then after setting adapter, you get the value if already exists. In your code instead of checking equal condition with "14" you check it with shared preference saved value and call setSelection(i) in if loop.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions