Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Items in Spinner (Customer Spinner Adapter) not selectable

 
Kavisha Paranamana
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a spinner in my android application and I have two questions about it. The drop down is appearing but I cannot select items of it. When I clicked in the spinner it is displaying the item list. But when I clicked on the item, nothing happen. I cannot identify selected item. When I print the position inside getView(int position, View convertView, ViewGroup parent) method, it prints all items id.

Also I want to know how to identify the selected item without displaying it in spinner as spinner usually does.


This is my CustomSpinnerAdapter :




spinner_layout.xml

 
Devaka Cooray
Marshal
Pie
Posts: 4894
409
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About identifying the selected items, it does not have anything to do with SpinnerAdapter, given that your SpinnerAdapter only takes care of the data view. Does your main spinner activity override OnItemSelectedListener.onItemSelected(-)? If it dos so, you have a 'view' parameter in that method, which can be used to identify the item selected. When you say the items are not selectable, does that mean that you don't see the visual impression of the items being selected, or your listener method does not get triggered upon?

About mangling the visual behavior of the spinner to hide the selected item being not shown on top, you need to extend Spinner. Note that by doing so, you are breaking Android UI design patterns.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic