• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting data entered in an edittext (xml created) and casting to a double  RSS feed

 
Dwayne Barsotta
Ranch Hand
Posts: 80
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry guys I'm laying in bed and this problem is killing me, I don't have the code in front of me.

But what I did was create 15 EditText field with android:type"numberDecimal" and gave them an id of "claim1" through "claim15".

What I want to do in my java file is take the numbers entered in the "claim#" field, then typecast to a double so I can mathematically work with the values entered in claim1 through claim15.

I had created:

EditText claim1 = (EditText)FindViewById(R.id.claim1);
String value = claim1.getText;

What I would love to do is get the value entered in all 15 EditText field, convert then to a double and add each field value to an array double[15].

Sorry guys I have never used xml for gui design so I'm struggling a bit. Sorry if my code is off a little but I had to get off the computer and I'm posting from bed, can't sleep cause I'm having issues figuring the proper way to accomplish this. Thank you
 
Tim Moores
Saloon Keeper
Posts: 3435
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly are you having problems with - converting a string to a double? The Double class has a method for that.
 
Dwayne Barsotta
Ranch Hand
Posts: 80
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm such an idiot, I didn't even think about Double claim1 = Double(...).

Thanks
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!