This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to add items dynamically to spinner with alertdialog

 
Patrick Martz
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i used this instead and it works fine for me.







 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic