Hi,

I have the code here:

        this.spinner = (Spinner) this.findViewById(R.id.spinner);

        ArrayAdapter<String> spinnerArrayAdapter = new
ArrayAdapter<String>(this,  android.R.layout.simple_spinner_item,
                                
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);
            }
        });

and part of the xml:

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

and the popup works.

But how can i make the initial dropdown widget (spinner) to disappear?
I only want the list of strings to be shown, select
one and then update the TextView?

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