• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

trying to add items dynamically to spinner with alertdialog  RSS feed

 
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



 
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.







 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!