Android Question Get the actual spinner text

Discussion in 'Android Questions' started by TERRIEN, May 5, 2015.


    TERRIEN Member Licensed 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 :)
  2. DonManfred

    DonManfred Expert Licensed User

  3. George Martinos

    George Martinos Member Licensed User

  4. walterf25

    walterf25 Well-Known Member Licensed User

    You need to do :
    X = whatever index you need to get


    TERRIEN Member Licensed User

    Oh it returns the value as a text ! Sorry for this stupid thread, but thanks for your help !

    TERRIEN Member Licensed User

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

    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 :
    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.
  7. Beja

    Beja Expert Licensed User

    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).
  8. klaus

    klaus Expert Licensed User

    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).
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice