Hi,

OK, I have created the spinner and it popus from a TextView (spinner
initially not visible), but when choosing a item from
the list the spinner widget is shown, id like to only display a list
of choices with no spinner and then feed back to the TextView.
Is that possible or do I need to choose another widget? I tried to
change the "android.R.layout.simple_list_item_1"
but with no luck.

Code below:

...
        ArrayAdapter<String> spinnerArrayAdapter = new
ArrayAdapter<String>(this,  android.R.layout.simple_list_item_1,
                                
this.getResources().getStringArray(R.array.months));
        spinner.setAdapter(spinnerArrayAdapter);

        spinner.setOnItemSelectedListener(new OnItemSelectedListener()
{
                        public void onNothingSelected(AdapterView<?> arg0) {
                        }

                        public void onItemSelected(AdapterView<?> parent, View 
v, int
position, long id) {
                                // TODO Code that does something when the 
Spinner value changes
                        }
                });

        month.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                spinner.setVisibility(0);
            }
        });
...

...
 <Spinner  android:id="@+id/spinner"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:drawSelectorOnTop="false"
           android:visibility="gone"/>
...

Regards Jonas.

On Sep 2, 2:20 am, WoodManEXP <[email protected]> wrote:
> I have had success making stuff appear and disappear with
> "setVisibility()." No visability, no response to user events.
> visability and response to user events.
>
> Good luck!
>
> On Sep 1, 4:28 pm, Jonas <[email protected]> wrote:
>
> > Hi,
>
> > How can I popup a spinner when clicking on a TextView?
> > I then like to choose a value an return this value for display in the
> > TextView, similar how a
> > Date/Time picker works.
>
> > Many thanks,
> > Regards Jonas.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to