Using the Spinner Control for Selecting Items

You may also like...

8 Responses

  1. Drini says:

    Hello,

    I am wondering if you could share a tip in making a choice’s list. For example:
    Spinner1 contains 5 strings (string1, string2, string3, string4, string5)
    and depending on the string selected by the user, the Spinner2 will display accordingly the strings related to Spinner1.string#

    User selects string2 in Spinner1 and based on that in Spinner2 user will see and choose stringA, stringB, stringC that belong to string2.

    Thank you
    Drini

    • Edward M says:

      Drini,
      If I understand the question, yes you can do this!

      In the Spinner1.AfterSelecting event handler, you can add code that does something like this:

      if Spinner1.Selection equals option 1 then

      set Spinner2.Elements to make a list “String A”, “String B”, “String C”

      else
      if Spinner1.Selection equals option 2 then
      set Spinner2.Elements to make a list “Option 2 A”, “Option 2 B”, “Option 2 C”

      If there are more items in the first selection list, then add each possible selection to the if-then-else statements for all possible values.

      Does this sound right to you? Let me know!

      Ed

  2. Drini says:

    Dear Ed,
    Thank you for the tip. It sounded right and with trials I was able to make it work with Spinners. Then I tried successfully with ListPickers by using ElementsFromString instead of Element > Make a List.
    Now when user selects a specific item from ListPicker1, the Listpicker2 gets populated accordingly and then Listpicker2 is called for showing the elements. It works great.

    Thank you again and wishing you a great week ahead.
    Cheers

  3. Rahim says:

    Dear Sir
    I am developing my app. I dont have much programming knowledge.
    Any how i am managing with ap inventor.

    I have a web Radio, In that i have 6 Channels, Each channel with 4 sound qualities.

    I have used one spinner for Channel selection, another spinner for sound quality selection.

    They both are working.

    But it is taking a delay not less than 10 to 15 seconds to switch between spinners and lists.

    I will give you the link of my app hosted in Google playsore. Please tell me how can i avoid this delay in spinners and lists.

    Thanks in advance

    Here is the link

    https://play.google.com/store/apps/details?id=appinventor.ai_indianplans.SUN_City_Radio_2

    SA Rahim

  4. Johng642 says:

    Muchos Gracias for your blog post. ckfbkddakeag

  5. Hi dude, i have also find out one good example

    Spinner Basics – Android

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress spam blocked by CleanTalk.
LinkedIn Auto Publish Powered By : XYZScripts.com