I want to parse EditText value as integer without using String. Is it possible? Just like:
Integer s1=edt1.getText().toInt();
Integer s1=Integer.parseInt(edt1.getText();
I want to parse EditText value as integer without using String. Is it possible? Just like:
Integer s1=edt1.getText().toInt();
Integer s1=Integer.parseInt(edt1.getText();
I think you have to use toString() before you can convert to an Integer. getText() returns and editable which - from what I can tell - is not a valid argument for any of the Integer conversion methods.
int woohoo = Integer.parseInt(editText.getText().toString());
You don't need to create an intermediate string if that's what you're asking. You can just pass the results of methods used to get the input to the parseInt() method.