I want to convert the type Editable
from an android EditText
to the type integer to do maths operations on a user input number
I tried the following:
int x=(int)R2.getText().toString();
but it gives me an error of cannot convert a string to int.
Fine, I got the answer:
int x = Integer.parseInt(R2.getText().toString());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With