views:

223

answers:

1

Hi,

I have a Website class that has 3 get,set properties ID, Name, URL.

For other hand i have a method that gets from database websites, and return a List

I would like to bind this List into a Spinner.

My questions are two:

  • Its possible to add these websites list into a Spinner ?

  • As my website class has the property ID and Name, is possible that after a item of the spinner is selected, have the ID and Name of the item website selected ?

Thanks a lot in advance.

Best Regards.

Jose.

+2  A: 

You can subclass CursorAdapter that will query db for the websites and set it via yourSpinner.setAdapter(..).

alex
Hi Alex, first of all thanks for your response.What do you mean with subclass it? why are the benefits that i can get with it?
Josemalive