ok im getting mad errors when i do this what is the correct way to do this?
Code:intPieces = Integer.valueOf(txtPieces.getText().valueOf());
Printable View
ok im getting mad errors when i do this what is the correct way to do this?
Code:intPieces = Integer.valueOf(txtPieces.getText().valueOf());
What are the value data types? I assume (may be wrong) that you're tryiung to convert a string to an integer value..?
If thats so, you can use:
int val = Integer.parseInt(stringValue);
You should remember that these sort of conversion methods throw exceptions when they fail - e.g. it's not a number value, therefore you should place try, catch to contain the problem.
Hope this is OK
HD