Android Question Get the actual spinner text

TERRIEN

Member
Licensed User
Longtime User
Hi, I found nothing by searching so I decided to open my own thread about my prob.

I just wanna know how can I do to get the spinner1 actual text (E or I) and add it to my var.

Found nothing about get the text of an spinner except SpinnerMap but this isn't working, and there is no spinner1.text so, thanks :)
 
Upvote 0
Hi, I found nothing by searching so I decided to open my own thread about my prob.

I just wanna know how can I do to get the spinner1 actual text (E or I) and add it to my var.

Found nothing about get the text of an spinner except SpinnerMap but this isn't working, and there is no spinner1.text so, thanks :)

You need to do :
Code: Copy
Spinner.GetItem(x)

X = whatever index you need to get

Walter
 
Upvote 0
And by the way, for the people who hasn't understand what has been said, here is the code :

Code: Copy
VARIABLE = Spinner1.SelectedItem
And for exemple VARIABLE will return, as string the text that is selected in the spinner, for my exemple 'E'.

In my exemple :
Code: Copy
    pers = Spinner1.SelectedItem
    pers = pers & Spinner2.SelectedItem
    pers = pers & Spinner3.SelectedItem
    pers = pers & Spinner4.SelectedItem

It return a 4 chars letters used to redirect the user to this page or this other one..

Hope I was enough understandable for you, according on the fact I have a pretty bad english.
 
Upvote 0
pers = Spinner1.SelectedItem
pers = pers & Spinner2.SelectedItem
pers = pers & Spinner3.SelectedItem
pers = pers & Spinner4.SelectedItem
I think you didn't test the above code..
If I correctly understood what you wanted, then the code should be:

pers = Spinner(1).SelectedItem
pers = pers & Spinner(2).SelectedItem
pers = pers & Spinner(3).SelectedItem
pers = pers & Spinner(4).SelectedItem

(in you don't want to include spinner(0).
 
Upvote 0
Back
Top