[android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Jim Graham
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 (ListString, ListInteger, ListCamera.Size, and probably Listint[]). So far, I've read all kinds of

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Kostya Vasilyev
The issue is that you're trying to cast *the array* whereas you intent was probably to cast *each element of the array*. You could try this: for (Camera.Size size : cameraSizeList) { stringArray.add(size.toString()); } ... etc Or you could combine the arrays into one Object[] array. The

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Jim Graham
On Thu, Mar 29, 2012 at 03:37:19PM +0400, Kostya Vasilyev wrote: The issue is that you're trying to cast *the array* whereas you intent was probably to cast *each element of the array*. I was just trying to directly convert the List (in this case, ListString) to an array of strings (String[]).

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Lew
Spooky wrote: Kostya Vasilyev wrote: The issue is that you're trying to cast *the array* whereas you intent was probably to cast *each element of the array*. I was just trying to directly convert the List (in this case, I was just trying ... implies that the rules of Java should

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Jim Graham
On Thu, Mar 29, 2012 at 11:35:32AM -0700, Lew wrote: Spooky wrote: Kostya Vasilyev wrote: The issue is that you're trying to cast *the array* whereas you intent was probably to cast *each element of the array*. I was just trying to directly convert the List (in this case, I was

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Lew
Spooky wrote: Lew wrote: Spooky wrote: Kostya Vasilyev wrote: The issue is that you're trying to cast *the array* whereas you intent was probably to cast *each element of the array*. I was just trying to directly convert the List (in this case, I was just trying ...

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Kostya Vasilyev
29 марта 2012 г. 23:07 пользователь Jim Graham spooky1...@gmail.comнаписал: Kostya answered my question with a perfectly useable solution, and I thought, in my response, that I made my appreciation for that clear. Apparently, I didn't make that as clear as I thought I did. Apologies,

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Jim Graham
On Fri, Mar 30, 2012 at 01:38:15AM +0400, Kostya Vasilyev wrote: 29 ? 2012 ?. 23:07 Jim Graham spooky1...@gmail.com???: In fact, I need to apologize for calling obj.toString() a typecast in my original message. It's not, of course, rather it's a method call. I think I

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Ray Tayek
At 04:21 AM 3/29/2012, you wrote: ... If I can just successfully (i.e., without a force close) get that Listx to x[] (where 'x' is String, Integer, etc.), I could then feed that to the ArrayAdapter and feed the Spinner. ... list.toArray(new String[0]) thanks --- co-chair http://ocjug.org/

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Lew
Ray Tayek wrote: At 04:21 AM 3/29/2012, you wrote: ... If I can just successfully (i.e., without a force close) get that Listx to x[] (where 'x' is String, Integer, etc.), I could then feed that to the ArrayAdapter and feed the Spinner. ... list.toArray(new String[0]) From the API docs

Re: [android-developers] populating a Spinner with various types of Listxxx class

2012-03-29 Thread Jim Graham
On Thu, Mar 29, 2012 at 03:42:29PM -0700, Ray Tayek wrote: At 04:21 AM 3/29/2012, you wrote: ... If I can just successfully (i.e., without a force close) get that Listx to x[] (where 'x' is String, Integer, etc.), I could then feed that to the ArrayAdapter and feed the Spinner. ...