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 :)
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

walterf25

Expert
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 :)

You need to do :
B4X:
Spinner.GetItem(x)

X = whatever index you need to get

Walter
 
Upvote 0

TERRIEN

Member
Licensed User
Longtime User
And by the way, for the people who hasn't understand what has been said, here is the code :

B4X:
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 :
B4X:
    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

Beja

Expert
Licensed User
Longtime User
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

klaus

Expert
Licensed User
Longtime User
@Beja
Don't confuse 4 individual Spinners called Spinner1, Spinner2, Spinner3, Spinner4.
With an Array of 4 Spinners Spinner(0), Spinner(1), Spinner(2), Spinner(3).
 
Upvote 0
Top