spinner help

This is a discussion on spinner help within the Android App Developers forums, part of the Droid Apps category; Big thanks again. took some playing with stuff to get it to work, but it works perfect now. I've been running into a lot of ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: spinner help

  1. Junior Droid
    Woodard2589's Avatar
    Member #
    32594
    Join Date
    Jan 2010
    Posts
    28
    Phone
    Enter Current Phone Model Here
    #11
    Big thanks again. took some playing with stuff to get it to work, but it works perfect now. I've been running into a lot of problems with not being able to use variables declared in other classes without putting final in front of it. so what exactly does that do, is it limiting me from how i can use it at the same time? Also I keep getting warning say ArrayAdapter is a raw type, and i have no idea what that means, and just uses @surpresswarning to hide it for now.
  2. Senior Droid
    SixStringTheory's Avatar
    Member #
    81359
    Join Date
    Jun 2010
    Posts
    129
    Phone
    DROID
    #12
    Quote Originally Posted by Woodard2589 View Post
    Big thanks again. took some playing with stuff to get it to work, but it works perfect now. I've been running into a lot of problems with not being able to use variables declared in other classes without putting final in front of it. so what exactly does that do, is it limiting me from how i can use it at the same time? Also I keep getting warning say ArrayAdapter is a raw type, and i have no idea what that means, and just uses @surpresswarning to hide it for now.
    ArrayAdapter wants you to tell it what type of data is going into it. Since you're using strings or charsequences you can use that. But it's not an error that'll prevent compiling, just a warning. Weird things CAN happen but in this case wouldn't. You could also use a <?> and then you're just telling it you don't really know before hand.

    the Final keyword's a bit trickier. It's a general Java concept. For variables it means the variable can only be set once. It doesn't make it immutable (ie: once it's set that variable can never ever change). But generally you need to declare varialbes as Final to make them accessible to a scope other than their own parent class.

    Think of it this way. You declare a variable, some int, and that int gets passed to a constructor of some anonymous class. But something else changes that int variable before it gets used in that anonymous class. So now the value that gets used is different from what you sent.

    So if it's declared final it'll get set and sent to the constructor, but since it's final it CAN'T change, and the anonymous class uses the right data.

    So that's why you can use any random "int x" inside its own class, but to make it available outside that class you need to use modifiers to change it's scope.

    Sort of. I'm probably a bit wrong but the general concept is there. Scope in java can get a bit tricky. But luckily Eclipse is good with quick fixes on things like that.
  3. Junior Droid
    Woodard2589's Avatar
    Member #
    32594
    Join Date
    Jan 2010
    Posts
    28
    Phone
    Enter Current Phone Model Here
    #13
    ok, that definately helps, i was wondering what was up with the <?> in the code you gave.

Sponsors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Need help with simple "Spinner" used to play selected looped audio
    By Minaris in forum Android App Developers
    Replies: 0
    Last Post: 12-14-2009, 09:39 PM

Search tags for this page

adapterview cannot be resolved to a type

,

adapterview is a raw type

,
adapterview raw type
,
android adapterview is a raw type
,
android spinner cannot be resolved to a type
,
android spinner onitemselected
,
android spinner onitemselected example
,
android spinner selector
,
cannot make a static reference to the non-static method find
,

droid spinner

,
must implement the inherited abstract method adapterview.oni
,
onitemselected view can not be resoved
,

onitemselectedlistener cannot be resolved to a type

,
setonitemselectedlistener spinner android
,

spinner cannot be resolved to a type

,
spinner onnothingselected
,
spinner setonitemselectedlistener
,

the method onitemselected(adapterview, view, int, long) o

,
the method onnothingselected(adapterview) of type new ada
,

the type new adapterview.onitemselectedlistener(){} must imp

Click on a term to search our site for related topics.

Tags for this Thread