As far as I remember you can use the method setSelection(int
position).

On 19 out, 10:11, humanoid <[EMAIL PROTECTED]> wrote:
> Thanks GUS!
>
> I actually figured it out myself. Now my next problem is how to set
> the spinner to show the "position" based on the _id when I go back to
> a page. ....
>
> On Oct 18, 4:38 pm, GUS <[EMAIL PROTECTED]> wrote:
>
> > Well, I have an application that does that, but its for version m5.
> > The code was something like this:
>
> >                 // SPINNER
> >                 s1 = (Spinner) findViewById(R.id.spinner1);
> >                 ArrayAdapter<CharSequence> adapter =
> > ArrayAdapter.createFromResource(
> >                                 this, R.array.tipo, 
> > android.R.layout.simple_spinner_item);
> >                 adapter
> >                                 
> > .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
> >                 s1.setAdapter(adapter);
> > //              s1.setSelection(1);
>
> >                 s1.setOnItemSelectedListener(new 
> > Spinner.OnItemSelectedListener() {
>
> >                         public void onItemSelected(AdapterView parent, View 
> > v,
> >                                         int position, long id) {
> >                                 tipo = position;
> >                         }
>
> >                         public void onNothingSelected(AdapterView arg0) {
> >                                 // TODO Auto-generated method stub
>
> >                         }
> >                 });
> >                 // END SPINNER
>
> > I'm gonna migrate the application an tell you later if something has
> > changed.
>
> > cordially, Gus.http://www.androidforum.com.br
>
> > On 18 out, 12:06, humanoid <[EMAIL PROTECTED]> wrote:
>
> > > All:
>
> > > Has anybody figured out how to populate a Spinner from SQLite table,
> > > displaying a description in the dropdown but getting an _id upon the
> > > user clicking on a value.
>
> > > I am trying to "recreate" the HTML select with which I am sure you are
> > > all familiar.
>
> > > Any feedback appreciated.
>
> > > P.S. I know how to populate and display a single column values.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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