This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Android and the fly likes trying to add items dynamically to spinner with alertdialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Android
Bookmark "trying to add items dynamically to spinner with alertdialog" Watch "trying to add items dynamically to spinner with alertdialog" New topic
Author

trying to add items dynamically to spinner with alertdialog

Patrick Martz
Greenhorn

Joined: Dec 12, 2009
Posts: 18
i get the following error when i try to add an item from an EditText input inside an alert dialog to a spinner through an adapter, actual code below.

error: Fatal Exception: main
java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:411)
at java.util.AbstractList.add(AbstractList.java:432)
at android.widget.ArrayAdapter.add(ArrayAdapter.java:178)
*at remoteGraphics.oac.Place_RemoteActivity$1.onClick(Place_RemoteActivity.java:121)

declarations:


*line in code



Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
I am not sure about that UnsupportedException.
But you can call notify datasetChanged method for that adapter. This method will work as refresh kind of thing.
Patrick Martz
Greenhorn

Joined: Dec 12, 2009
Posts: 18
i used this instead and it works fine for me.







 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: trying to add items dynamically to spinner with alertdialog
 
jQuery in Action, 3rd edition