wood burning stoves 2.0*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to add items dynamically to spinner with alertdialog