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 ..." implies that the rules of Java should
> accommodate
> > your programming instead of the other way around.
>
> No, it doesn't. It implies (rather strongly) that I thought, based on
> the portions of the Dev Guide that I'd read on this, that I knew what I
> was doing. I was wrong. Get over it...I have.
>
You might want to cool your attitude down a notch, there, buddy.
> > Java doesn't let you cast across type hierarchies. Thus, you cannot cast
> > 'Camera.Size' to 'String', nor can you cast 'Camera.Size[]' to
> 'String[]'.
>
> Nor did I try (nor WOULD I try to do something stupid like that). Go
> back and READ my original post. I said that I hadn't even GOTTEN to any
> Camera.Size stuff---so far, only one, and that WAS a String[]. Where,
> from THAT, do you get that I'm assuming I can just cast (and thus
> magically translate) Camera.Size to String[]? Answer: you don't.
>
Since you provided woefully incomplete information. we have to guess. You
shouldn't be shouting at me for that. You never said anyhthing about
casting a 'String[]' because you didn't say what type 'bar' is. So get off
your bloody high horse, bubba.
Since you didn't tell us at all yet, what is the type of 'bar'?
> > You might find the Java tutorials informative.
>
> Again, read what I posted. How many Java books did I go through? I lost
> count.
>
Zero.
Or you wouldn't have made the mistake you did, Mr. Attitude.
> > > List<String>) to an array of strings (String[]). I hadn't gotten
> > > as far as the other settings types yet---just preparing for them
> > > when I get to them.
>
> There...see, I said it again. I hadn't gotten being List<String> and
> String[]. Read what you're replying to next time. :-)
>
Boy, you love to be rude, don't you?
Do you think a smiley makes your comment less obnoxious?
I ask again, what was the type of 'bar'?
You cop all this attitude, bu you leave out the vital datum.
> > > > You could try this:
> > > >
> > > > for (Camera.Size size : cameraSizeList) {
> > > > stringArray.add(size.toString());
> > > > }
> > > >
> > > ... etc....I was hoping for a direct conversio for each List to each
> > > respective array, but I'm starting to think that might not be ideal,
> > > after all.
>
> And just in case that was misunderstood, I was saying that I liked his
> idea, and that I thought it would work for me.
>
> > > > Or you could combine the arrays into one Object[] array. The adapter
> > > > would then call toString on each Object inside the array.
> > >
> > > Again, multiple arrays, not one.
> > >
> > Again, he's just making suggestions. Again.
>
> Yes...I know. But the above assumes (or at least, appears to assume)
> that I'm handing one huge list of settings to the spinner, whereas I'm
> planning to reuse one spinner with multiple sets of data. I haven't
> tried that yet, and if it doesn't work, that'll be just another lesson
> learned for me. So I was just clarifying what I had in mind.
>
> > > > But if you do that, you won't be able to refer to objects in the
> > > > array and know their types (which may be useful), unless you used
> > > > "instanceof".
> > >
> > > I've already got that covered. :-) A simple switch() in
> onItemClicked
> > > will determine which type of settings are in effect, and respond
> > > accordingly.
> >
> > Switching on types is an antipattern in O-O programming. Polymorphism,
> will
> > do that switch for you.
>
> Did I say ANYTHING about switching based on variable types? No. I was
>
Yes, you said and quoted again, "A simple switch() in onItemClicked will
determine which type of settings are in effect".
What kind of "type" did you mean?
> saying that I would use the switch to take actions based on what the DATA
> was. In other words, if spinner item #2 is "Incandescent" then I know
> that the spinner's current data set is White Balance settings.
> Understand now? :-)
>
I understand that you are obnoxious. Smiley faces don't reduce your
rudeness, Flame Boy.
> > > Either way, I can use the example you showed above, and I think that'll
> > > work for me.
> > >
> > The wrapper approach is one way but I normally use the simple array-copy
> > technique. Why are you so afraid of that loop?
>
> You mean the loop that, in the quoted text that you just responded to, I
> I said I liked the loop idea, and implied that I would probably just use
> it? Hmmmm? Read *what I wrote*. If you're trying to read my MIND,
> instead, you're doing an absolutely miserable job of it. Even my CATS
> do better than that (actually, they do really well at it). :-)
>
You are pathetic.
--
Lew
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en