While working on my current app, I find myself needing to populate
a spinner (and a MultiSpinner, but that one's easy---feed it the
list directly) from data that's stored in various types of Lists
(List<String>, List<Integer>, List<Camera.Size>, and probably
List<int[]>).

So far, I've read all kinds of stuff about the ArrayList type, and
when I search for List<x> I get ArrayList<x[]> instead.  I THOUGHT
I had the solution, using

   String[] foo = bar.toArray();

Eclipse threw an error, and required me to cast that to String[] as:

   String[] foo = (String[]) bar.toArray();

And this caused a force close, where the error stated that you can't
cast toArray() to String[].

I've gone through multiple searches through this list, Stack Overflow,
XDA, google, books and e-books on both Android and Java in general, and
have yet to find anything that works.  If I can just successfully (i.e.,
without a force close) get that List<x> to x[] (where 'x' is String,
Integer, etc.), I could then feed that to the ArrayAdapter and "feed"
the Spinner.

Could someone help me out with that, please?  I'm sure that toArray()
is part of the answer, but I haven't found a working example, and my
(mis) understanding of it was clearly wrong.

Thanks,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)            MiSTie #49997      < Running FreeBSD 7.0 >
spooky1...@gmail.com                    ICBM/Hurr.: 30.44406N 86.59909W

Seen in alt.sysadmin.recovery:  "Priceless; that's better than telling
him to use the Read Manual command with the Real Fast option."

Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to