Android - Add typed objects to spinner widget
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(..)
.
精彩评论