I tried using Integer.parseInt(), but it doesn't convert it EditText's String input to integer. I need to use integers to multiply data and calculate total. EditText is not empty.
Solution 1:
Instead of this,
a = Integer.parseInt(textIn1.getText().toString());
try it,
a = Integer.valueOf(textIn1.getText().toString());
Also add
android:inputType="number"
in your xml layout file.
<EditText...android:inputType="number"/>
to input only numbers.
Share
Post a Comment
for "Convert Edittext Input To Integer And Multiply?"
Post a Comment for "Convert Edittext Input To Integer And Multiply?"