Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Spinner Values

 
Liam O'Connor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys,

Im creating an app to determine the value of a resistor depending on the band colours.
Ive the barebones created, with just one spinner at the minute.
I want to be able to use one first and then ill set up the other bands.

So i have a textView resistorValue, that i want to change, depending on the value selected in the spinner.
For now, what I want is -if black is selected, the value in resistorValue is 1000, if no, its 0.

Right now, its not finding myText for me which is the value selected in the spinner.

 
Campbell Ritchie
Sheriff
Posts: 51446
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't appear to have the barebones at all, I am afraid. You have some sort of GUI. What you need first is a command‑line app which recognises resistor colours. When you have got that running, consider adding a GUI atop it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this an Android app?
 
Liam O'Connor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, its an android app.

What i meant by barebones, was barebones of the gui.
I think if i can just get to a point where i can assign a value to a selection on the spinner i should be ok from there, hopefully.

At the minute, i have the spinner come up and you can select black, blue etc.
What i'm struggling with is assigning a value to that black, blue, etc.

How do i do this..

In english what im trying to do is..

Have a variable called resistorValue(right now i have this as a textView - problem.?)
If black is selected I add 1000 to resistorValue,
If blue is selected I add 100 to resistorValue,

Am i way out of my league trying to use spinners at this stage, should i just use a different button for each colour in each band.?

Thanks..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, that's really important information that you should include with your question.

I've moved this to the Android forum for you.
 
Liam O'Connor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ok, thanks - I just assumed that it fell under the java heading. I'll know for again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic