0
I would like to know how to, after selecting an option of the spinner, save it at the time of the form for change, example: I choose option 2, when it is time to change the form, the selected option of the spinner will be option 2, not option 1
0
I would like to know how to, after selecting an option of the spinner, save it at the time of the form for change, example: I choose option 2, when it is time to change the form, the selected option of the spinner will be option 2, not option 1
Browser other questions tagged android android-studio spinners
You are not signed in. Login or sign up in order to post.
Use
posicao = spinner.getSelectedItemPosition()
To get the position of the selected item, store it in the same way as the other form data. When changing the selection on Spinner throughspinner.setSelection(posicao);
– ramaral
but I will need after that, save position in the database?
– Marcos Martins
Yes, you should keep it in the database along with the other form data.
– ramaral
The data that fill the Spinner are also database?
– ramaral
saved me, just like that, I finished my TCC!
– Marcos Martins
as I finish by saying that you help me and help in the reputation?
– Marcos Martins
There’s no need to do anything, it’s enough for me to know that I’ve been able to help.
– ramaral
I’m also studying this, please @ramaral, don’t need to use spinner ID? how to differentiate from other spinners on the same page?
– Camila Yamamoto
You must have a field in the table for each spinner.
– ramaral