问题描述:

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.

网友答案:

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

相关阅读:
Top